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. :)
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;
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
is the same as
but add this
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. :)