字体大小不适用于 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;
}
它应该工作
关于css - 字体大小不适用于 Opera 和 Chrome,但适用于 Firefox,虽然其他参数有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45976527/