0

我正在为我的 hr 设计样式,为此,我将这个角色§放在中心。这是代码

hr.style-eight:after {
 content: "§";
 display: inline-block; 
position: relative;
 top: -0.7em;
 font-size: 1.5em;
 padding: 0 0.25em;
 background: white; 
}

我已经查看了几个用于方形字符的字符实体备忘单,但到目前为止还没有。我可以使用的现有 html 或 html5 实体中是否有方形字符或 css3 中可以产生方形的替代方法?

4

2 回答 2

3

HTML5 Character Entity Reference(你应该已经看过了):

□
□ □ □
□
□

还有:

▪
▪ ▪ ▪ ▪
▪
▪
于 2014-01-07T09:41:13.207 回答
2

使用边框?

CSS

h1:after{
    content:'';
    display: inline-block;
    width: 5px;
    height: 5px;
    border: 1px solid black;
}

小提琴

于 2014-01-07T09:41:08.287 回答