Jump to content

how to centre something...


visitor

Recommended Posts

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

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.