首页 > Web开发 > 详细

[CSS] Easily Reset Styles With a Single CSS value

时间:2016-12-09 08:35:29      阅读:155      评论:0      收藏:0      [点我收藏+]

There are times where you need to reset a an element’s styles. Instead of overwriting it with even more style declarations, you can simply reset them.

 

/* Styles go here */

body {
  color: #d200ff;
}

button {
  color: white;
  font-size: 14px;
  background: lightgreen;
  text-align: center;
  border: none;
  padding: 10px 20px;
}

section {
  font-size: 16px;
}
section button {
  color: unset; /*since section doesn‘t have color set, will use body color*/
  font-size: unset; /*use section font-size*/
}

 

 

[CSS] Easily Reset Styles With a Single CSS value

原文:http://www.cnblogs.com/Answer1215/p/6148010.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!