As it turns out, just nest two divs inside each other, and you have it made.
<div style="width:100%; border: 1px solid black; text-align:center;">
This is a 100% wide box
</div>
<div style="width:100%;">
<div style="margin-left: 15px; margin-right: 15px; border: 1px solid black; text-align:center;">
This is a 100% wide box with a 15px margin
</div>
</div>
This is a 100% wide box
This is a 100% wide box with margins...
Look how it overflows to the right!
there is no way in CSS to calculate 100%-30px to get this right. And the margins and padding actually GROW the box!
Look how it overflows to the right!
there is no way in CSS to calculate 100%-30px to get this right. And the margins and padding actually GROW the box!
This is a
style="margin-left: 15px; margin-right: 15px;"
div
inside a style="width: 100%;" div
inside a style="width: 100%;" div
...
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
No comments:
Post a Comment