I am attempting to make a div with a background color stick to the top of its parent container. My goal is to have something structurally resembling this:
I've tried vertical-align:top; and removing padding (which I have left in), but I can't seem to get it to work.
Here is a demo of my current HTML and CSS.
.well {
min-height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
}
.section-title {
background-color: lightblue;
width: auto;
display: block;
}
<section class="well">
<div class="section-title">
<p>/title/</p>
</div>
<p>section content</p>
</section>