Nathali Posted October 29, 2007 Posted October 29, 2007 Hi, I installed a contribution that do that, but it didn't work so good :( And there is a fix to it that I didn't understand how to do this to fix the problem. Here is the installation instruction, If someone could help please? ----------------------------- ---------------------------------Geting the OsCommerce Centered - by Omar2886--------------------------------- This change will make a visual style change to your e-shop which could make it more atractive. First of all, you'll have to make a backup of this files: - Header.php - Footer.php - Stylesheet.css Follow the instructions: 1- Open the header.php and before this code: <table border="0" width="100%" cellspacing="0" cellpadding="0"> Insert this one: <div border="1" class= "centerpage"> Save and close. 2- Now, open the footer.php and after the end of all the code: After this one: ?> Insert this: </div> Save and close. 3- Now open the stylesheet.css, and in the begining of the code, just after the (*/) insert this: DIV.centerpage { width: 70%; position: absolute; left: 42%; top: 0; margin-left: -27%; background: #FFFFFF; } Save and close. The backgrounf define the colour of the spaces to the left and right, is not the same as the body's background so you can change the color value # to other you want (now is set white #FFFFFF) You also could change the % values to set differents margins and dimensions of the body. The distances are seted in % because if you set them in px's the page will change depending on the resolution of the pc where is opened the Web. ------------------------------------------------------ AND HERE IS THE distribution FIX (that I do not know how to do it) ------------------------------------------------------ Using the div around the outermost table definition to center the table exposes a bug in the css implmenetation of certain versions of Microsoft Intenet explorer. These versions of IE do not implment css standards as they are defined. IE will not treat the table entirely as a block element as it should. The nested table inside a div on IE 6 will not always center if you do not also define margins on the table. To fix this bug and to be all browser compatible, it is a simple fix. You just have to give a margin definitely to the table in order to force ie to treat it correctly. For example. <style> div.outer { text-align:center; } table.outer { margin-left:auto; margin-right:auto; } </style> <DIV CLASS="outer"> <TABLE CLASS="outer"> html stuff goes here </TABLE> </DIV> You can add background color and the like to the outer div if you want to. I also usually tell the table.out to have a margin-top:0px; This way you can also avoid hardcoding an align-center within the table tag... moving you closer to eventually going to completely tableless design. have fun! --------------------------------------------- Could someone help me please? Thankx Best Regards, Nathali
Guest Posted October 29, 2007 Posted October 29, 2007 I do not know this one, but the one I have workd fine.Download : fixedwith with css2
Nullachtfuffzehn Posted October 29, 2007 Posted October 29, 2007 You got to add the class="outer" to the table tag where you added the div before. Then add the mentioned css code to your stylesheet.css. Since you gave your div tag already a class you can add the style of div.outer to that class definition.
Nathali Posted October 29, 2007 Author Posted October 29, 2007 Thank you so much for your advises. I already uninstalled the first contrib. and I am going to install fixed Fixed Width Site With CSS There the code is very clear to me. Thanks again, Best Regards, Nathali
Recommended Posts
Archived
This topic is now archived and is closed to further replies.