YUI
Reset CSS这条线为我造成了麻烦:
address,caption,cite,code,dfn,em,strong,th,var { font-style: normal; font-weight: normal; }@H_502_4@它使我的em不是斜体,而我的强者不是大胆的.没关系我知道如何在我自己的样式表中重写.
strong,b { font-weight: bold; } em,i { font-style: italic; }@H_502_4@当我的文字都是em和strong时,问题出现了.
<strong>This is bold,<em>and this is italic,but not bold</em></strong>@H_502_4@我对强者的统治使得它变得大胆,但是YUI对于em的规则使得它再次成为正常的.我该如何解决?
解决方法
如果你的强烈声明是在YUI的你的应该覆盖它之后.你可以这样强迫它:
strong,b,strong *,b * { font-weight: bold; } em,i,em *,i * { font-style: italic; }@H_502_4@如果您仍然支持IE7,则需要添加!重要.
strong,b * { font-weight: bold !important; } em,i * { font-style: italic !important; }@H_502_4@这样做 – 看看你自己:
/*YUI styles*/ address,var { font-style: normal; font-weight: normal; } /*End YUI styles =*/ strong,b * { font-weight: bold; } em,i * { font-style: italic; }
<strong>Bold</strong> - <em>Italic</em> - <strong>Bold and <em>Italic</em></strong>