I'm trying to center a figure with max-width
defined. When centralizing without max-width
, that's right. But the background exists in it is 100% non-centered next to figure .
For this I used max-width
, but when using figure it aligns the left again.
Is there any other way?
<figure id="img-home">
<img src="img/col-1.jpg" alt="Cotação Individual, Familiar, Empresarial">
<figcaption>
<strong>Cotação</strong>
<span><a href="#">Individual</a> | <a href="#">Familiar</a> | <a href="#">Empresarial</a></span>
</figcaption>
</figure>
#img-home {background: #eed46f; padding: 5px; max-width: 330px; text-align: center;}