字体大小不适用于Opera和Chrome,但适用于Firefox,但其他参数正常工作
问题描述:
字体大小不适用于Opera和Chrome,但适用于Firefox。制作边框,边距,动画,大小,字体系列,但不包括字体大小。字体大小不适用于Opera和Chrome,但适用于Firefox,但其他参数正常工作
我有一个复杂的ul-li导航嵌套跨度。我无法在内部<a>
上设置字体大小。我没有在其他部分/元素上设置字体,除了html - 16px
。我试过rem和px单位,没有一个在Opera和Chrome中工作。是否有一种特殊的方式来设置深嵌套元素的字体大小?为什么其他规则正在工作?
<div> <span>..12 spans... <span>
<a class='a.aBtn' ><span class='navDecr' ></span></a>
...other 12 <a> tags ...
<ul> <li></li> ...12 li ... </ul>
</span> ... 12 closing spans </div>
//the same error a.aBtn span.navDescr {}
a span.navDescr {
font : 2rem, "Open Sans", sans-serif !important; //this is stroked through
text-align: right;
text-align-last:left;
font-weight:normal;
font-variant: normal;
font-style:normal;
line-height : 1.5; //will be multiplied with font_size
font-stretch: normal;
font-size-adjust:1;
}
如果我试图把字体上li
项目的孩子,它也不起作用。制作边框,边距,动画,大小,字体系列,但不包括字体大小。
答
您应该使用font-size
如果你想改变字体的大小和font-family
将其更改为另一种字体从
<a class='a.aBtn' ><span class='navDecr' >Test</span></a>
a span.navDescr {
font : 2rem, "Open Sans", sans-serif !important; //this is stroked through
text-align: right;
text-align-last:left;
font-weight:normal;
font-variant: normal;
font-style:normal;
line-height : 1.5; //will be multiplied with font_size
font-stretch: normal;
font-size-adjust:1;
}
更改为
<a class='aBtn' ><span class='navDecr' >Test</span></a>
.aBtn span {
font-size : 2rem;
font-family: "Open Sans", sans-serif !important; //this is stroked through
text-align: right;
text-align-last:left;
font-weight:normal;
font-variant: normal;
font-style:normal;
line-height : 1.5; //will be multiplied with font_size
font-stretch: normal;
font-size-adjust:1;
}
它应该工作
答
似乎原因是在一些其他字体规则。 最后,请查明“行高”规则使字体大小在Opera和Chrome浏览器中不起作用。 我的意思是复杂的结构与问题无关。
a.aBtn span.navDescr, a.aBtn span.navDescr p {
font-family : "Open Sans", sans-serif !important;
font-size : $aBtnFontSize !important;
text-align: right;
text-align-last:left;
font-weight:normal;
font-variant: normal;
font-style:normal;
//font_size : 3rem !important;
// line-height : 1.5; //opera ignores : MAKES THIS ERROR
font-stretch: normal;
font-size-adjust:1;
}
你试过分开字体大小和字体家族吗? –