CSS inset Property
How many times have you set the same value for top
, bottom
, left
, and
right
to fill an absolutely positioned element to fit it’s parent element?
Thankfully there is an easier way!
Next time instead of writing this:
p { top: 0; bottom: 0; left: 0; right: 0;}
Combine all the properties together using the inset
shorthand:
p { inset: 0;}
Checkout the MDN docs for more details!