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

buttoninput这样的表单控件,不同的浏览器都会有自己的样式风格(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

你可能感兴趣的:(使用inherit属性值继承其父元素样式来覆盖UA自带样式。)