visitor Posted November 10, 2009 Share Posted November 10, 2009 Hi, I've been told that to centre something I have to do this... to simply add a div wrapper around the entire slideshow code and center it using margin auto. <div id="slideshow-wrapper"> --all the slideshow code goes here-- </div> Example: If the slideshow overall width is 600 pixels, then you would give that div the following css: #slideshow-wrapper {width: 600px; margin: 0 auto;} unfortunately this doesn't work. Has anyone got another idea how to centre things? Thanks Quote Link to comment Share on other sites More sharing options...
merylvingien Posted November 11, 2009 Share Posted November 11, 2009 div#slideshow-wrapper { height:auto; margin:auto; position:relative; width:600px; } Try that! Quote Link to comment Share on other sites More sharing options...
haku Posted November 11, 2009 Share Posted November 11, 2009 Is your wrapper absolutely positioned? If so, the margins won't work. Quote Link to comment Share on other sites More sharing options...
visitor Posted November 11, 2009 Author Share Posted November 11, 2009 Hi, Thanks for your suggestions...! Unfortunately some contents are positioned absolutely. I think that's the reason why the "div slideshow-wrapper" doesn't work. visitor Quote Link to comment Share on other sites More sharing options...
visitor Posted November 21, 2009 Author Share Posted November 21, 2009 Hi Has anyone got an idea why I can't centre this one, please...? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>test</title> <style type="text/css"> div#slideshow-wrapper { height:auto; margin:auto; position:relative; width:512px; } </style> </head> <body> <div id="slideshow-wrapper"><img src="ip0001-001.jpg" width="512px" height="384px"></div> </body> </html> thanks visitor Quote Link to comment Share on other sites More sharing options...
haku Posted November 22, 2009 Share Posted November 22, 2009 I already told you why: Is your wrapper absolutely positioned? If so, the margins won't work. Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 22, 2009 Share Posted November 22, 2009 the solution is to not use absloute positioning on any main elements but simply position the elements within a main div and make those specific elemnts positions absolute instead allowing you to still have relativley positioned content on your page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.