gpt4 book ai didi

css - FF 在 :after element (CSS) 上应用随机字体大小

转载 作者:太空宇宙 更新时间:2023-11-04 13:19:17 26 4
gpt4 key购买 nike

我有这个基本上是 <span> 的圆形加号上课 plus .在 CSS 中,我渲染了一个包含 + 的 :after 元素。字符 ( \ff0b )。奇怪的是,Firefox 呈现了 + 的字体大小。与普通的 Plus 非常不同。 Chrome 做得对。

在这张截图中,左边是 Chrome,右边是 Firefox。为了比较,我在“alle”之前添加了一个普通的加号字符。忽略灰色渐变,那只是浏览器窗口的阴影:

enter image description here

这是 CSS:

 .plus {
display: inline-block;
margin-right: 0.2em;
margin-top: -2px;
vertical-align: middle;
color: white;
background: rgba(0, 161, 228, 0.8);
width: 1.1em;
height: 1.1em;
border-radius: 1.1em;
text-align: center;
line-height: 1.1em;
}
.plus:after {
content: "\ff0b";
}

HTML 再简单不过了:

<span class="plus"></span>+ alle Kategorien

最佳答案

似乎如果您将\ff0b 替换为实际的“+”,则两种浏览器中的呈现是相同的:

 .plus:after {
font-family: Arial;
font-size: 11px;
content: "+";
}

http://jsfiddle.net/r47JB/3/

我还设置了字体大小和字体粗细,以确保它不会继承。

关于css - FF 在 :after element (CSS) 上应用随机字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24189876/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com