'Css Position Property

It's the image without using position property enter image description here

.Brand-image {
   width: 55%;
   transform: rotate (25deg);
   margin-left: 20%;
   position: absolute;

But after applying above position property it's size increases enter image description here



Solution 1:[1]

Your width is being calculated as a percentage of the parent width.

When you change the position to absolute, the bounding element becomes the page body, so the width is calculated as a percent of the body width.

Using absolute positioning always leads to difficulty.

Solution 2:[2]

You have to make the parent position: relative;. Then the image will take 55% width of its relative parent div.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 themartin
Solution 2 Nikesh Kp