1. 真正需要重置的标签也就下面这些,其它的直接用默认属性即可,完全没必要重置。
html, body {
min-height: 100vh;
}
body, p, ul, ol, dl, dd, h1, h2, h3, h4, h5, h6, pre, hr, fieldset, figure, menu {
margin: 0;
}
ul, ol, th, td, button, input, textarea, menu {
padding: 0;
}
ul {
list-style-type: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
hr {
border-bottom: none;
}
button, input, textarea, iframe {
border: none;
}
button, input, textarea {
background-color: transparent;
}
button:focus, input:focus, textarea:focus {
outline: none;
}
textarea {
width: auto;
height: auto;
resize: none; /* 不允许手动拉伸 */
}
iframe {
display: block;
}
img {
vertical-align: bottom;
}
2. fieldset标签与legend 单独处理一下,具体根据需要设置
fieldset {
padding: 10px 20px;
text-align: center;
border-width: 1px;
}
legend {
padding: 0 10px;
}
3. a标签各个点击状态单独处理,具体根据需要设置
/****
设置a标签的样式须遵循link-visited-hover-active顺序;
没有href属性,将没有a:link和a:visited的状态;
只设置a的样式,不设置四种状态的样式,那么四种状态会都继承a的样式;
****/
a {
text-decoration: none;
}
a:link {
color: blue;
}
a:visited { /* 已点击状态 */
color: green;
}
a:hover { /* 鼠标悬停状态 */
color: yellow;
text-decoration: underline;
}
a:active { /* 点下去的时的状态 */
color: red;
}
其它标签根据实际情况做单独调整即可。