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>
More Related Contents:
- Why isn’t it possible to combine vendor-specific pseudo-elements/classes into one rule set?
- Is it possible to set the stacking order of pseudo-elements below their parent element? [duplicate]
- How can I write a ‘:hover’ condition for ‘a:before’ and ‘a:after’?
- Why do the :before and :after pseudo-elements require a ‘content’ property?
- CSS :after not adding content to certain elements
- CSS rotate property in IE
- Font Awesome 5 Choosing the correct font-family in pseudo-elements
- Why don’t :before and :after pseudo elements work with `img` elements? [duplicate]
- Can I change the height of an image in CSS :before/:after pseudo-elements?
- CSS :before on inline SVG
- Is there a way to use SVG as content in a pseudo element ::before or ::after
- Can I target a :before or :after pseudo-element with a sibling combinator?
- Should I use single or double colon notation for pseudo-elements?
- How can I make generated content selectable?
- Add line break to ::after or ::before pseudo-element content
- Universal selector * and pseudo elements
- Can I have multiple :before pseudo-elements for the same element?
- CSS3 transition on click using pure CSS
- Combine :after with :hover
- Z-index with before pseudo-element
- Cross browser way to rotate image using CSS?
- Are CSS3 ::before and ::after pseudo elements supported by IE9 or not?
- CSS Pseudo Element Counters: can you increment an alphabet letter “a”, “b”, “c”, etc instead of a number?
- Vertically centering content of :before/:after pseudo-elements
- “text-decoration” and the “:after” pseudo-element, revisited
- Should I use single colons (:) or double colons (::) for before, after, first-letter and first-line pseudo-elements?
- Change style of pseudo elements in angular2
- prevent a pseudo element from triggering hover?
- Apply webkit scrollbar style to specified element
- CSS3 transitions on pseudo-elements (:after, :before) not working?