码迷,mamicode.com
首页 > Web开发 > 详细

[CSS] Easily Reset Styles With a Single CSS value

时间:2016-12-09 08:37:51      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:text   reset   button   val   sim   center   one   iframe   res   

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

标签:text   reset   button   val   sim   center   one   iframe   res   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!