如何使unicode三角形更宽

德帕·乔普拉(Depak Chopra)

我正在使用内容的伪元素制作要漂浮在鞋帮外侧的三角形

问题的设置:使此小提琴上的蓝色三角形变宽(但保持其高度)

.bluebox { margin-top: 50px; background: blue; min-width: 300px; min-height: 200px; position: relative;}
    .bluebox:after { content: "\25B2"; color: blue; position: absolute; font-size: 2em; top: -0.8em; left: 5%;}

为此,我需要调整什么属性?

哈希笔

如果不支持IE8及更低版本,则可以将scaleX()转换功能与伪元素一起使用。

例如(由于简洁,省略了供应商前缀):

.bluebox:after {
    /* other declarations... */
    content: "\25B2";
    transform: scaleX(1.5);
}

在线示例:

.bluebox {
    margin-top: 50px;
    background: blue;
    min-width: 300px;
    min-height: 200px;
    position: relative;
}

.bluebox:after {
     content: "\25B2";
    color: blue;
    position: absolute;
    font-size: 2em;
    top: -0.8em; left: 5%;
    -webkit-transform: scaleX(1.5);
    -moz-transform: scaleX(1.5);
    -ms-transform: scaleX(1.5);
    -o-transform: scaleX(1.5);
    transform: scaleX(1.5);
}
<div class="bluebox"></div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章