CSS 清除默认样式
通常的清除默认样式:
*{ margin:0; padding:0}li{ list-style:none}img{ vertical-align:top; border:none}设置默认字体
body,button, input, select, textarea { font: 14px/1.5 tahoma, \5b8b\4f53, sans-serif;}h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal;}address, cite, dfn, em, var { font-style: normal; } code, kbd, pre, samp { font-family: courier new, courier, monospace; } small { font-size: 12px; } /** 重置列表元素 **/ul, ol { list-style: none; }/** 重置文本格式元素 **/a { text-decoration: none; }a:hover { text-decoration: underline; }sup { vertical-align: text-top; } sub { vertical-align: text-bottom; }/** 重置表单元素 **/legend { color: #000; } fieldset, img { border: 0; } button, input, select, textarea { font-size: 100%; } article, aside, details, figcaption, figure, footer,header, hgroup, menu, nav, section,summary, time, mark, audio, video { display: block; margin: 0; padding: 0;}mark { background: #ff0; }:-moz-placeholder { color: #ddd; opacity: 1;}::-moz-placeholder { color: #ddd; opacity: 1;}input:-ms-input-placeholder { color: #ddd; opacity: 1;}input::-webkit-input-placeholder { color: #ddd; opacity: 1;}select标签
select { border: none; appearance:none; -moz-appearance:none; -webkit-appearance:none; background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent; padding-right: 14px;}重置表格元素
table {border-collapse: collapse;border-spacing: 0;}重置hr
hr { border: none; height: 1px;}清除< ol > < ul >的默认样式
ul, ol, { margin: 0; padding: 0; list-style: n;}.button按钮
.button{ border:0; background-color:none outline:none; -webkit-appearance: none;//用于IOS下移除原生样式}.< a >标签
a{ text-decoration:none; color:#333;}< input >标签
input{ border: none; appearance:none; -moz-appearance:none; outline:none;//input标签聚焦不出现默认边框: -webkit-appearance: none;//用于IOS下移除原生样式}//or:input:focus{ outline:none; }//input标签聚焦不出现默认边框:border: none; appearance:none; -moz-appearance:none; outline:none;//input标签聚焦不出现默认边框: -webkit-appearance: no总结
以上所述是小编给大家介绍的css清除默认样式和设置公共样式的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!