I have a div containing a paragraph. I want to add a translucent background image to the paragraph but only upto height same as height of the paragraph. I have:
<div id = "phase1box">
<div id = "phase1content" class = "phasecontent">
<h1>Phase 1</h1>
<p>
• some text.<br/>
• some text.<br/>
• some text.<br/>
• some text.<br/>
• some text.<br/>
</p>
</div>
</div>
CSS:
#phase1box {
position: absolute;
top: 0%;
width:100%;
height:18%;
background-image: url("../assets/phase1box.png");
}
I have hard coded height: 18%
but instead i want the background image to take height of the div (paragraph). If i do height: auto
no background image shows up.
`, I presume.
](https://html.spec.whatwg.org/dev/embedded-content.html#the-br-element) tag does not use and does not need a closing slash and never has in any HTML specification. – Rob May 25 '23 at 07:36