How to apply multiple transforms in CSS?


Tags: css,css3,transform

Problem :

Using CSS, how can I apply more than one transform?

Example: In the following, only the translation is applied, not the rotation.

li:nth-child(2) {
    transform: rotate(15deg);
    transform: translate(-20px,0px);        
}


Solution :

You have to put them on one line like this:

li:nth-child(2) {
    transform: rotate(15deg) translate(-20px,0px);
}

When you have multiple transform directives, only the last one will be applied. It's like any other CSS attribute.


    CSS Howto..

    How to select all fields from a single box?

    How can I align an image to the center in a Bootstrap column?

    How to make CSS compatible with all browsers?

    how to style margins between items in a
    list?

    How to add spacing between two span elements

    PHP: How to add a CSS text-align property to an already present inline style attribute of an element using simple_html_dom parser?

    how to translate this xpath into css selector

    How to add text with css without pseudo-element

    CSS: How to change the color of the bottom right square of the scrollbar in webkit?

    How to handle hiding dynamic elements in JQUERY with different names but same CSS class

    how to disable the highlighting view on selection either in html or css?

    how to change the background color of the holder of an image using jquery cycle

    ASP.NET Gridview - How do I change the color properties vertically?

    How to set url of fonts in css file into mvc project?

    Internet Explorer 10 menu item shows focus outline unexpectedly

    How to make a transition effect that just perform like css transition?

    Compiling Bootstrap in LESS - How can I have a different navbar height for mobile?

    How to apply CSS selector on Select Option Child

    How to use custom css file for layout of a module in Yii2

    How to display a div at the center of viewport?

    How to make a floated element take the entire width of its parent

    How to style a GtkLabel with CSS?

    how to make a CSS animation end point the right edge of the browser

    Text and image in div - How to align correctly?

    How to align a background image to bottom of table cells in css?

    How to Prevent Opacity for Sub Div using Jquery

    How can I force text to “normal” (not bold) using css?

    How to keep website footer at bottom even when page expands downwards

    Cant figure out how to apply css to menus in my footer

    how to add embedded ruby in style tag