How to Rotate a Unicode Symbol in a Pseudo-Element?

Mary-Kate Olsen
Release: 2024-10-31 18:44:02
Original
828 people have browsed it

How to Rotate a Unicode Symbol in a Pseudo-Element?

Rotate Pseudo-Element Content Values

Question:

How can you rotate a pseudo-element's content value given that they are inline and can't be directly transformed?

Specifically, we want to rotate a Unicode symbol.

<code class="css">::after {
  content: "B6";
}</code>
Copy after login

Answer:

Inline elements cannot be transformed, and pseudo elements are inline by default. To make them transformable, you must set their display property to either block or inline-block.

<code class="css">#whatever:after {
  content: "B6";
  display: inline-block;
  transform: rotate(30deg);
}</code>
Copy after login
<code class="html"><div id="whatever">Some text</div></code>
Copy after login

The above is the detailed content of How to Rotate a Unicode Symbol in a Pseudo-Element?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!