Reputation: 37
how do I stop this box from stretching? Here's the code and the result:
CSS:
.social {
padding-left: 1000px;
border: 5px inset black;
margin: 4px;
width: 100px;
}
HTML:
<div class="social">
<p>Social</p>
</div>
Result:
Upvotes: 0
Views: 227
Reputation: 3034
As commenters have pointed out, your 1000px padding is adding the space. That's what the padding property does - it adds padding.
If you want 'social' to live in a 100px left column (my guess looking at your styles), remember that you will need to float your column, set it as an inline block, or lay it out with either CSS tables or flexbox.
Upvotes: 1