what has text-align got to do with image?
I was just reading this article :-
http://css-tricks.com/perfect-full-page-background-image/
Please note this css :-
#bg td {
text-align:center;
vertical-align:middle;
}
What is text-align doing in here? If i just remove that property开发者_开发知识库, it stops working. CSS can be quiet difficult to understand sometimes :(
Thanks in advance :)
Image elements are inline-block
by default which basically means that things that normally apply only to text applies to images as well, but it also means that you can put e.g. padding and margin on the element, which you cannot put on elements that are normally "inline" such as span
.
So what I'm trying to say is that since images are inline-block
, the CSS property text-align
applies to them.
精彩评论