Rotate Element with CSS deg

Sometimes we want to give an element a little twist — like turning a card or spinning a button. In CSS, we can use the transform property with degrees — written as deg.

Here’s an example

HTML:

<div class="card">Click me!</div>

CSS styling:

.card {
  transform: rotate(15deg);
}

This rotates the .card 15 degrees clockwise.

Key Points ^-^

  • deg stands for degrees — it tells how much to rotate

  • rotate(15deg) turns clockwise, rotate(-15deg) counter-clockwise

  • Can be animated or combined with hover for fun effects

  • Works on any HTML element