Abdullah Furkan Özbek
Furkan's Notes

Follow

Furkan's Notes

Follow
How to Rotate Background Image

How to Rotate Background Image

Abdullah Furkan Özbek's photo
Abdullah Furkan Özbek
·Jul 25, 2021·

1 min read

Play this article

It is as simple as adding a before or after element inside a container

.container {
  position: relative;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: url(background.jpg) 0 0 repeat;
  transform: rotate(30deg);
}
 
Share this