html - Inherit parent's height without height specified -
I have the following:
The problem is that the blue line is running in between the divs only The parent should have the height of ( .bux
), but this is not possible because there is no fixed height for .box
because the heights can vary.
How can I fix this?
HTML:
& lt; Div class = "box" & gt; sample text. & Lt; / Div & gt; & Lt; Div class = "box" & gt; Some more lessons & Lt; Br / & gt; Different height & lt; / Div & gt;
CSS:
.box {padding: 50px 0; Text align: center; Limit: 1px solid black; Margin-down: 20px; } .box: after {content: ""; Height: 100%; Width: 5px; Background: blue; Display area; Status: Completed; Top: 0; Left: 50%; Margin-left: -2.5px; Z-index: -1; }
Just add the status: relative
box Div Bela here:
Comments
Post a Comment