您的位置:首页 > Web前端 > CSS

css常用技巧

2016-06-19 19:19 357 查看
body,ul,ol,dl,dd,h1,h2,h3,h4,h5,h6,p,input,select,textarea,form{margin: 0; padding: 0;}

body{font:14px/1.5 "宋体";}

img{border:none;}

ul,ol{list-style:none;}

input,select,textarea{outline:none;border:none;background:none;}

textarea{resize:none;}

a{text-decoration:none;}

/*清浮动*/

.clearfix:after{content:"";*display:block;*clear:both;}

.clearfix{zoom:1;}

选择

::selection {background-color:#669900; color:#ffffff; text-shadow:none;}

::-moz-selection {background-color:#669900; color:#ffffff;text-shadow:none;}

去掉a的下划线

a {blr:expression(this.onFocus=this.blur())} /*if IE*/

a {outline:none;}/*if 火狐等现代浏览器浏览器*/ 

省略号

white-space:nowrap;overflow:hidden;text-overflow:ellipsis;

英文自动换行

word-break: break-all;

强制不换行

white-space:nowrap;

contenteditable="true"

-------------------------------------------------

clearfix完整版

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

.clearfix:after{clear:both;}

.clearfix{*zoom:1;}

--------------------------------------------------

expression(this.onFocus=this.blur())
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: