The HTML markup I am working with looks like this:
<ul data-role="listview" data-inset="true" class="stuff site-content lists">
<li>
<div class="nearby"> 20 </div>
<h1> name</h1>
</li>
</ul>
I have the following CSS code:
.nearby{width: 85px;
height: auto;
float: left;
margin-right: 10px;
font-size: 26px;
text-align: center;
padding: 15px 0;
border: 2px #c1c1c1 solid;
background: #fafafa;
}
li{padding: .7em 15px;
display: block;
}
Currently, the div does not align properly in the middle due to its height. Is it possible to adjust the li
item's height dynamically based on the div
instead of the h1
?