Forum Moderators: not2easy

Message Too Old, No Replies

CSS Centering background issue

         

roo42

2:25 pm on Aug 1, 2009 (gmt 0)

10+ Year Member



Hi, First post here so please be gentle on the noob!

I'm using templates from 1234.info, but as it doesn't do exactly what I want I'm trying to hack code out of other style sheets.

This is working to try get a 'slideshow' to display centrally. I have the background image using the div class 'slideshow' and an animated gif over this on the page code thus -

css - /* slideshow */
.slideshow{width:500px;height:423px;overflow:hidden;background:transparent url('../img/bg-slideshow.jpg') no-repeat 0 0}.slideshow img{height:423px;}

pagecode -
<div class="slideshow">
<img class="center" src="./img/test.gif" alt="text?" width="500" height="439" /></a>
</div>

Though I can get the gif to align center, I can't shift the background or even keep the gif aligned center when activating the slideshow div.

Any help to center this as it's been sending me around in circles for the last 24hours!

TIA

LostInFL

3:04 pm on Aug 1, 2009 (gmt 0)

10+ Year Member



Have you tried setting left and right margins for the slideshow class to auto?

margin-right: auto;
margin-left: auto;

roo42

3:23 pm on Aug 1, 2009 (gmt 0)

10+ Year Member



Awesome! You Freaking Rock Dude! Thanks for the very fast response and correctly identifying the issue!
have a <beer>