I have a section set to a fixed width and a 100% width div inside of it with a 5 pixel border.
Looks fine but you can tell the containing div is a bit off center and it wouldn't be without the border, which I need to match the client comp.
The code is rather straightforward:
#info {
max-width: 980px;
margin: 0 auto;
}
.info-box {
border: 5px solid #0033A0;
display: inline-block;
text-align: center;
padding: 48px 0;
width: 100%;
}
<section id="info">
<div class="info-box">SOME CONTENT</div>
</section>
The only thing I can think of is to make the width of the .info-box
to be 98% or something like that, but that's still not going to truly work. So will anything?
BTW, I already tried adding relative positioning, set display to inline
instead of inline-block
....none of which worked.