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

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

WBOY
WBOYOriginal
2016-06-24 11:33:021656browse

像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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn