'Css Position Property
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 |


