Is it possible to center an image on both axis inside a div?
Posted
by Noor
on Stack Overflow
See other posts from Stack Overflow
or by Noor
Published on 2010-04-22T16:14:40Z
Indexed on
2010/04/22
16:23 UTC
Read the original article
Hit count: 256
I have a script that loads in a div with images running jQuery Cycle Lite Plugin.
I got the tip that I could us the "after" function in that plugin to make changes to the picture each time the image is refreshed. So I wrote this:
$("#display div").css({
margin: "0 auto",
"text-align": "center",
});
The html built like this:
<div id="display">
<div id="slideshow1">
<img ... />
</div>
</div>
This isn't working, whats wrong?
( this is supposed to center it horizontally, i need to center it vertically to )..
© Stack Overflow or respective owner