I have a section set to a fixed width and an inner width width of 100% with a border of 5 pixels.
It looks good, but you can say that the containing div is a bit off center and it will not be without a border, which I need to fit the client comp.
The code is pretty simple:
#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>
Run codeHide resultThe only thing I can think of is to make the width .info-boxequal to 98% or something like that, but that still doesn't work. So what will happen?
By the way, I already tried to add relative positioning, set the display to inlineinstead of inline-block.... none of which worked.
source
share