css 旋转一个伪 :after 或 :before content:"" [英] css rotate a pseudo :after or :before content:""

查看:41
本文介绍了css 旋转一个伪 :after 或 :before content:""的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何都要对伪进行旋转

anyway to make a rotation work on the pseudo

content:"24B6"? 

我正在尝试旋转一个 unicode 符号.

I'm trying to rotate a unicode symbol.

推荐答案

内联元素不能转换,伪元素默认是内联的,所以必须应用 display: blockdisplay: inline-block 来转换它们:

Inline elements can't be transformed, and pseudo elements are inline by default, so you must apply display: block or display: inline-block to transform them:

#whatever:after {
  content: "24B6";
  display: inline-block;
  transform: rotate(30deg);
}

<div id="whatever">Some text </div>

这篇关于css 旋转一个伪 :after 或 :before content:""的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆