Quote:
Originally Posted by JSWolf
It does not at all look similar nor behave similar to em units in percentage (for instance, you can't actually CENTER the content with a left and right margin using percentage units;
|
You can't truly center anything without using more than just margins, and you don't need to touch margins to center something...
text-align: center; centers the content.
OTOH, you can use the following to "center" an image without centering text:
Code:
.image-box {
text-align: left;
margin-left: 20%;
margin-right: 20%;
}
.image-fill {
width: 100%;
}
<p class="image-box"><img src="some-image.png" class="image-fill"><br />
An un-centered caption.
</p>