I want to make a div for showing content in a small box. I want the div to be auto width but it is always going 100% of the parent div, is div maybe not the best way?
<div class="rental-feature">
<span class="feature-icon door"></span>
<span class="feature-text">2222222</span>
</div>
Here is a link to an image of what I am trying to do, the content in feature text should control the width. But when I make it as is, the code always goes to 100% of the parent div.
Set the div to display:inline-block; in the css.
It should then get the width of the content instead of filling out the parent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With