Answers for "css position absolute but take up space"

CSS
0

css position absolute but take up space

this ought to work:

-by definition, absolutely positioned elements are removed from the normal flow of the document. So in order to have the video element’s height control how much vertical space gets taken up by your yellow background, you’ll need to switch it back to relative positioning.

-however, if you change all your videos to relative positioning, they’ll appear in a long stack because they’re back in the normal flow of the document

-so set just the first video to relative positioning, and use absolute positioning for the subsequent videos. The first video will control the height of the yellow background, and subsequent videos won’t take up additional space in the document.

-you’ll probably need to add a bottom margin to the first video to get the sizing just right

hope that helps!
Posted by: Guest on February-14-2022

Code answers related to "css position absolute but take up space"

Browse Popular Code Answers by Language