How to clear the default style in CSS

Usually clear the default style:

*{
    margin:0;
    padding:0
}
li{
    list-style:none
}
img{
    vertical-align:top;
    border:none
}

Set the default font:

body {
font-family: "Microsoft YaHei";
font-size:14px;
color:#333;
}

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;
 }/* 小于 12px 的中文很难阅读, 让 small 正常化 */

/** 重置列表元素 **/
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%;
 } /* 使得表单元素在 ie 下能继承字体大小 */

/* 重置 HTML5 元素 */
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; 
}

/* 设置placeholder的默认样式 */
:-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 tag

select {
    border: none;
    appearance:none;
    -moz-appearance:none;
    -webkit-appearance:none;
    padding-right: 14px;
}

Clear the default style of <ol> <ul>

ul, ol, { 
  margin: 0;
  padding: 0;
  list-style: n;
}

.button button

.button{
    border:0;
    background-color:none;
    outline:none;
}

.< a >label

a{
    text-decoration:none;
    color:#333;
}

< input >label

input{
    border: none;
    appearance:none;
    -moz-appearance:none;
}

input:focus{
 outline:none;
 }/*input标签聚焦不出现默认边框:*/

Guess you like

Origin blog.csdn.net/QIANDXX/article/details/112170067