Jump to content

Can't center div's


RazvanTM

Recommended Posts

hello. i recentlly started working on a new theme. the problem is i used layers and they are all aligned but way off center ofn different resolutions. I tried using iframe but i can't get to sync the iframe background with the webpage bg. right were the iframe border should be(disabled it). i can't get a good fix on it, if i center it for FF it will be offcenter for opera, IE, avant and chrome, if i fix it for chrome it will be off for the other. the only browser that is consistent and displays it right without any ajutstments is IE.

Someone suggested i use a container but i can't figure out how, it always messes really bad the layout.

any alternatives to this problem ? :-s

 

difference betwen browsers: http://box225.net/main/imagini/iframe.jpg

example iframe: http://box225.net/main/iframe.php

without iframe: http://box225.net/main/index.php

index.php code: http://box225.net/main/text.html

Link to comment
https://forums.phpfreaks.com/topic/178342-cant-center-divs/
Share on other sites

Well, you can do one thing. But all your divs in a containing div. Set the CSS for the containing div to this:

 

div#container
{
  position:relative;
  width: ___px; //set this to the width of the contained divs, so that it entirely encloses them
  margin:0 auto;
}

 

But that being said, you are better to remove all the absolute positioning, and learn to use floats.

Link to comment
https://forums.phpfreaks.com/topic/178342-cant-center-divs/#findComment-940595
Share on other sites

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.