自己用的一套reset.css,打算整理一下方便以后用,持续更新中,各位大神,不喜勿喷...

本文详细介绍了CSS与HTML的基本样式规范,包括清除浮动、弹性布局等,并提供了常见样式的实现方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

*{margin: 0; padding: 0;border:none;}
img{
vertical-align: top;
width: 100%;
border: none;
}
ul,li{
list-style: none;
}
input,textarea{outline:none}
a{
-webkit-tap-highlight-color:rgba(0,0,0,0);
text-decoration: none;
}
a:hover{ text-decoration:none;}
.overflow-x{
overflow-x: hidden;
}
.overflow-y{
overflow-y: hidden;
}
.txt-l{
text-align: left;
}
.txt-c{
text-align: center;
}
.txt-r{
text-align: right;
}
.fl{
float: left;
}
.fr{
float: right;
}
/*清除浮动*/
.clearfix:after{
content:"";
height:0;
line-height:0;
display:block;
visibility:hidden;
clear:both;
}
.clearfix{
zoom:1;
}
.flex{/* ie10  */
  display: -webkit-flex; /* Safari  */
  display: flex;
}
.border-box{
box-sizing:border-box;
}
/*超出隐藏*/
.ellipsis{
white-space:nowrap; 
text-overflow:ellipsis; 
-o-text-overflow:ellipsis; 
overflow: hidden; 
}
/*两行超出隐藏*/
.ellipsis2{
overflow:hidden; 
text-overflow:ellipsis;
display:-webkit-box; 
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}
/*需手动更新模块*/
/*两行超出隐藏,火狐*/
@-moz-document url-prefix() {/* Moz */
.ellipsis2{
position: relative; 
line-height: 20px; 
max-height: 40px;
overflow: hidden;
}
.ellipsis2::after{
content: "..."; 
position: absolute; 
bottom: 0; 
right: 0; 
padding-left: 40px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(left, transparent, #fff 55%);
}
}

转载于:https://www.cnblogs.com/jocelyn-liu/p/8404343.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值