Day 81: the order of individual transform properties

On day 66, I’ve introduced you to individual transform properties. An interesting detail about these properties is the order in which transforms are applied compared to the transform property.

If you use the transform property, transformation functions are applied in the order of appearance, from left to right.

<button class="button1">Button 1</button>
<button class="button2">Button 2</button>
.button1 {
  transform: translateX(50px) scale(1.5); 
}

.button2 {
  transform: scale(1.5) translateX(50px); 
}

With individual transform properties, the order of appearance of the declarations doesn’t matter. The order is always the same: translate –> rotate –> scale.

.button3 {
  translate: 50px 0;
  scale: 1.5; 
}

.button4 {
  scale: 1.5; 
  translate: 50px 0;
}

If you mix transform and individual properties, individual transforms get applied first.

.button5 {
  transform: translateX(50px); 
  scale: 1.5;
}

.button6 {
  transform: scale(1.5); 
  translate: 50px 0;
}

My blog doesn’t support comments yet, but you can reply via blog@matuzo.at.


This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović

On day 66, I’ve introduced you to individual transform properties. An interesting detail about these properties is the order in which transforms are applied compared to the transform property.

If you use the transform property, transformation functions are applied in the order of appearance, from left to right.

<button class="button1">Button 1</button>
<button class="button2">Button 2</button>
.button1 {
  transform: translateX(50px) scale(1.5); 
}

.button2 {
  transform: scale(1.5) translateX(50px); 
}


With individual transform properties, the order of appearance of the declarations doesn’t matter. The order is always the same: translate –> rotate –> scale.

.button3 {
  translate: 50px 0;
  scale: 1.5; 
}

.button4 {
  scale: 1.5; 
  translate: 50px 0;
}


If you mix transform and individual properties, individual transforms get applied first.

.button5 {
  transform: translateX(50px); 
  scale: 1.5;
}

.button6 {
  transform: scale(1.5); 
  translate: 50px 0;
}


My blog doesn't support comments yet, but you can reply via blog@matuzo.at.


This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović


Print Share Comment Cite Upload Translate Updates
APA

Manuel Matuzović | Sciencx (2023-01-16T00:00:00+00:00) Day 81: the order of individual transform properties. Retrieved from https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/

MLA
" » Day 81: the order of individual transform properties." Manuel Matuzović | Sciencx - Monday January 16, 2023, https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/
HARVARD
Manuel Matuzović | Sciencx Monday January 16, 2023 » Day 81: the order of individual transform properties., viewed ,<https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/>
VANCOUVER
Manuel Matuzović | Sciencx - » Day 81: the order of individual transform properties. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/
CHICAGO
" » Day 81: the order of individual transform properties." Manuel Matuzović | Sciencx - Accessed . https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/
IEEE
" » Day 81: the order of individual transform properties." Manuel Matuzović | Sciencx [Online]. Available: https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/. [Accessed: ]
rf:citation
» Day 81: the order of individual transform properties | Manuel Matuzović | Sciencx | https://www.scien.cx/2023/01/16/day-81-the-order-of-individual-transform-properties-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.