0

我想在 unicode 字符上面放一个字符串。

就像是:

在此处输入图像描述

所以我必须做两件事:

1) change the width of the unicode character
2) put the string above the unicode character

这是我的jsfiddle:

http://jsfiddle.net/alonshmiel/EXCU8/32/

这是我的CSS:

font.sub-menu-item:before {
    content: "\21C0";
    width:200px;
}

div.upperChar {
    padding-top:30px;    
}
4

1 回答 1

2

您需要设置字体的大小。您可以使用 控制其位置margin

jsFiddle 演示

font.sub-menu-item:before {
    content: "\21C0";
    font-size: 170px;
    line-height: 0;
    margin: -10px 0 0 -15px;
}

另外,为什么你需要一个额外的元素呢?:after这是一个使用伪类且只有一个元素的更好示例。

jsFiddle 演示

div.upperChar:after {
    content: "\21C0";
    font-size: 170px;
    line-height: 0;
    display: block;
    margin-left: -20px;
}
于 2013-09-01T09:52:24.490 回答