[CSS] Easily Reset Styles With a Single CSS value

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*/
}

 

 

posted @ 2016-12-09 02:53  Zhentiw  阅读(172)  评论(0编辑  收藏  举报