根据标签自身属性重新整理了一下reset css,方便后面开发时使用

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;
}

其它标签根据实际情况做单独调整即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值