I am trying to transform my menu items by rotating them 10 degrees. My CSS works in Firefox but I\'ve failed to replicate the effect in Chrome and Safari. I know IE doesn\'t
Since nobody referenced relevant documentation:
CSS Transforms Module Level 1 - Terminology - Transformable Element
A transformable element is an element in one of these categories:
- an element whose layout is governed by the CSS box model which is either a block-level or atomic inline-level element, or whose display property computes to table-row, table-row-group, table-header-group, table-footer-group, table-cell, or table-caption
- an element in the SVG namespace and not governed by the CSS box model which has the attributes transform, ‘patternTransform‘ or gradientTransform.
In your case, the elements are inline by default.
Changing the display property's value to inline-block renders the elements as atomic inline-level elements, and therefore the elements become "transformable" by definition.
li a {
display: inline-block;
-webkit-transform: rotate(10deg);
-moz-transform: rotate(10deg);
-o-transform: rotate(10deg);
transform: rotate(10deg);
}
As mentioned above, this only seems to applicable in -webkit based browsers since it appears to work in IE/FF regardless.