首页 > 代码库 > [CSS] Easily Reset Styles With a Single CSS value
[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*/}
<iframe style="width: 100%; height: 200px;" src="https://embed.plnkr.co/gS0FK5PxJW5I1r1yK0zf/" width="320" height="240"></iframe>
[CSS] Easily Reset Styles With a Single CSS value
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。