- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › how do i use the auto selector to place an image tag in the middle of a DIV tag
hi everyone.
i want to place an image in the middle of a “div tag”.
i tried using the auto selector to do this but it does not work.
so, i was wondering, does the auto selector work with Img tag. i tried the following;
.picmiddle img {
margin:0 auto 0 auto;
}
Images are inline elements by default. Set display block then margin: 0 auto to center it.
ah. that is great. thanks HugoGiraudel.
one question; do you mean i should margin 0 first and then subsquently use the auto
warm regards
Andreea
He means that
margin: 0 auto;
is the same as
margin:0 auto 0 auto;
but add this
display:block;
Like this: http://codepen.io/Paulie-D/pen/grosf
wow. great. thanks guys.
i really appriciate this
I guess I wasn’t clear enough. Sorry. :)