View Single Post
Old 01-24-2025, 03:29 PM   #6
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 522
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Quote:
Originally Posted by JSWolf View Post
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>
nabsltd is offline   Reply With Quote