欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

使用inherit属性值继承其父元素样式来覆盖UA自带样式。_html/css_WEB-ITnose

程序员文章站 2022-03-14 23:35:16
...
像button、input这样的表单控件,不同的浏览器都会有自己的样式风格(UA样式)。我们可以使用inherit继承其父元素样式,从而覆盖浏览器的UA样式。

button,input,select,textarea {    color: inherit;    font-family: inherit;    font-style: inherit;    font-weight: inherit;}

来自Airen的博客:http://www.w3cplus.com/css/back-to-the-roots.html