前端常用css3公共样式集合

本文深入解析CSS公共样式的设置技巧,包括去除默认样式、优化显示效果及清除浮动的方法。掌握这些核心内容,能够帮助前端开发者提升网页布局的精确性和响应速度。

CSS公共样式格式:

* {

margin: 0;

padding: 0

}

/*让所有斜体 不倾斜*/

em,

i {

font-style: normal;

}

/*去掉列表前面的小点*/

li {

list-style: none;

}

/*图片没有边框 去掉图片底侧的空白缝隙*/

img {

border: 0; /*ie6*/

vertical-align: middle;

}

/*让button 按钮 变成小手*/

button {

cursor: pointer;

}

/*取消链接的下划线*/

a {

color: #666;

text-decoration: none;

}

 

/*a:hover {

color: #e33333;

}*/

 

button,

input {

font-family: 'Microsoft YaHei', 'Heiti SC', tahoma, arial, 'Hiragino Sans GB', \\5B8B\4F53, sans-serif;

outline: none;

}

 

/*body {

background-color: #fff;

font: 12px/1.5 'Microsoft YaHei', 'Heiti SC', tahoma, arial, 'Hiragino Sans GB', \\5B8B\4F53, sans-serif;

color: #666

}*/

 

.hide,

.none {

display: none;

}

/*使用after伪元素清除浮动*/

.clearfix:after {

visibility: hidden;

clear: both;

display: block;

content: " ";

height: 0;

}

.clearfix {*zoom:1;} /*IE6,7*/

 

/*使用双伪元素清楚浮动*/

.clearfix:bofore, .clearfix:after{content:"";display:table;}

.clearfix:after{clear:both;}

.clearfix{*zoom:1;}

 

/*多行溢出(超出省略)*/

.text-two-dot{

overflow: hidden;

text-overflow: ellipsis;

display: -webkit-box;

-webkit-line-clamp: 2;

-webkit-box-orient: vertical;

word-break: break-word;

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值