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
https://forums.phpfreaks.com/topic/181018-how-to-centre-something/
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

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.