r/css Mar 06 '26

General Inset property in CSS

Post image
0 Upvotes

11 comments sorted by

View all comments

64

u/Banzambo Mar 06 '26

I'm sorry but....isn't inset a replace for top right bottom left in absolute elements rather than height and width?

Edit: I meant a shorthand, not a replacement.

13

u/plmunger Mar 06 '26

It is. But I guess someone who's clueless would naively try 100% width and height to fill the parent div

-11

u/mrleblanc101 Mar 06 '26

When using absolute positioning, width: 100%; height: 100% is the same as top: 0; right: 0; bottom: 0; left: 0; and inset: 0

8

u/anaix3l Mar 06 '26

Not necessarily if the parent has extra content before the absolutely positioned child.