Just starting out with Vue and diving into the world of CSS3!
I'm currently working on a component that you can check out here: https://codesandbox.io/s/yjp674ppxj
In essence, I have a ul
element with relative positioning, followed by a series of div
elements with absolute positioning where I dynamically calculate the top
property.
My goal is to display text after the entire list, but when I attempt this, the ul
element ends up with a height of 0px
. How can I maintain height while achieving the desired outcome?
Below is a simple HTML5 & CSS3 example:
ul {
position: relative;
border: solid 1px coral;
}
li {
position: absolute;
top: calc(10px * var(--index));
border: solid 0.5px black;
}
<ul>
<li style="--index:0">list item</li>
<li style="--index:1">list item</li>
<li style="--index:2">list item</li>
<li style="--index:3">list item</li>
<li style="--index:4">list item</li>
</ul>
<p>test that should appear after the list</p>