Please explain in detail this part of YUI3 CSS Reset

99封情书 提交于 2019-12-01 20:04:01

The first rule actually doesn't apply on IE only, but on all webbrowsers. Normally you would like to define a global font in the body:

body {
    font: 1.1em verdana, arial, sans-serif;
}

But this doesn't get applied (inherited) on the form controls in all webbrowsers. That rule would then apply (only) the font size on them as well. One way is to set the font to inherit on those elements:

input, select, textarea {
    font: inherit;
}

But that doesn't work in IE6/7. Another way is to just explicitly include the elements in the rule:

body, input, select, textarea {
    font: 1.1em verdana, arial, sans-serif;
}

That only the font-size is been set is probably because the YUI guys would like to keep the form controls their own browser-default font family (which is sans-serif for input and select and is monospace for textarea). The 100% is been used because IE6/7 doesn't support inherit.

As to the second rule: I am not sure what they meant here. I did a little test in IE6/7. The legend just inherits the color from its parent element. Maybe the actual problem lies somewhere else?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!