New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Needs to be part of the td tag.
http://stackoverflow.com/questions/8603914/center-image-in-table-td-in-css
align:0 auto;
is what I use.What about Vertical?
I assume you're using
<img src="#" class="tag"/>
?yes.
vertical is a little bit different. i think you're gonna need some javascript magicks for that. there's an easy way to do it with jquery.
My site is already heavy enough , don't want to make it more.
td img.tag { text-align: center; }
@NinjaHawk Post your code on Pastebin? It's easier when you can play around with it yourself.
jquery's not that heavy...
@AsadHaider nothing to post. Simple table code with CSS mentioned above.
this one? http://www.w3.org/Style/Examples/007/center.en.html
or http://css-tricks.com/snippets/css/absolute-center-vertical-horizontal-an-image/
Just add a text-align:center;vertical-align:middle; to the td surrounding the image.
Horizontal centering:
Inline elements: Set
text-align: center;
for the parent (block level) element.Block level elements:: Set
margin: 0px auto;
on the element itself.Vertical centering:
Inside a <td> or table-cell element: Set
vertical-align: middle;
on the table cell.Inside anything else: You're basically screwed. (There are some tricks, though.)
@joepie91 That worked like a charm
This is a bad bad thread
http://www.w3schools.com/tags/tag_center.asp
HTML 3 will never die!