Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

website alignment center


sheraz

Recommended Posts

I have changed setting in file: index.php to center. now main page is in center. i also want header to be in center. Header is in full page. how can i change that into center. and when i click on other pages then other pages are also not in center. kindly help me, how can i make all the webpage into center.

Link to comment
Share on other sites

You do it by using <div>

 

In your style sheet add

 

body, html {

background: #C1C1C1;

color: #000000;

margin: 0px;

padding:0px;

text-align: center;

}

 

#centre{

width: 800px;

margin: 10px auto 10px auto;

background: White;

text-align: left;

}

 

 

 

Then in your header.php around line 55 and just before the HTML starts add

<div id= "centre" >

 

 

in your footer.php

right on the last line and after the ?> add

</div>

 

Nic

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Link to comment
Share on other sites

i've used this method to centre the site for my oscommerce site, but it doesn't centre it in Internet Explorer, it looks fine in Firefox though. Can anyone tell me how i can use this method but so that it centres in internet explorer also???

Link to comment
Share on other sites

i've used this method to centre the site for my oscommerce site, but it doesn't centre it in Internet Explorer, it looks fine in Firefox though. Can anyone tell me how i can use this method but so that it centres in internet explorer also???

 

The:

 

#centre{

width: 800px;

margin: 10px auto 10px auto;

background: White;

text-align: left;

}

 

Should be:

 

#centre{

width: 800px;

margin: auto;

background: White;

text-align: center;

}

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Well my stylesheet actually looks like that at the moment after a few modifications i made the other day.

 

 

#content {
width: 900; margin: auto;
border: 1px solid #000000;
background: #ffffff;
text-align:center;
}

#header {
width: 900; margin: auto;
border-left: solid 1px #000;
border-right: solid 1px #000;
border-top: solid 1px #000;
align:center;

background: #ffffff;
text-align:center;
}

 

 

I have two div tables, one just for the header and one for everything else, and as you can see with the above code i have modified them slightly, but it doesn't seem to be working in internet explorer atall.

Link to comment
Share on other sites

Often people say they did things, they did`nt, I dont know why.

 

Fimble said, add to the body tag: text-align: center; did you do that really?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I had this problem too,

 

Your CSS for the Center Div seems to be fine, you only need 1 div element, someone helped me with this all you do is find where your table starts in header.php then end it in footer.php (i assume you have done this.

 

Now what you may have not done is put text-align:center in the body CSS heading this will make it work in internet explorer, you need it to either say center or left I cant remember.

 

Heres mine:

 

BODY {

background: #ffffff;

color: #000000;

margin: 0px;

align: center;

text-align:center;

}

 

DIV.centerpage {

width: 780px;

top: 0;

margin:auto;

background: #FFFFFF;

 

}

 

That will do it for ya, change as needed.

 

Well my stylesheet actually looks like that at the moment after a few modifications i made the other day.

 

 

#content {
width: 900; margin: auto;
border: 1px solid #000000;
background: #ffffff;
text-align:center;
}

#header {
width: 900; margin: auto;
border-left: solid 1px #000;
border-right: solid 1px #000;
border-top: solid 1px #000;
align:center;

background: #ffffff;
text-align:center;
}

 

 

I have two div tables, one just for the header and one for everything else, and as you can see with the above code i have modified them slightly, but it doesn't seem to be working in internet explorer atall.

Link to comment
Share on other sites

Often people say they did things, they did`nt, I dont know why.

 

Fimble said, add to the body tag: text-align: center; did you do that really?

and they will say they didn't do things, when they did. Must be something to do with taking responsibility for their actions.

Link to comment
Share on other sites

just to clear up, i did actually do what was done before but there was no difference, for some reason once i replaced a few lines from an original file it worked, so it looked like i mis typed something.

 

The reason i have two DIV tables is because i wanted to completely seperate them so i could have seperate values for the header and body - for instance putting a background image in css class for the header, and a seperate one for the body. Also where borders are concerned, i wanted to close off the borders with different widths and styles for both.

Link to comment
Share on other sites

just to clear up, i did actually do what was done before but there was no difference, for some reason once i replaced a few lines from an original file it worked, so it looked like i mis typed something.

 

The reason i have two DIV tables is because i wanted to completely seperate them so i could have seperate values for the header and body - for instance putting a background image in css class for the header, and a seperate one for the body. Also where borders are concerned, i wanted to close off the borders with different widths and styles for both.

 

 

Thanks for being honest about your error, too often people have errors they blame on the software or anything else, they can cause long threads yet just go silent once they twig.

 

For your info, its the text-align:center; in the body tag that ie obeys, thats why I thought you had'nt done it.

Others including firefox obey the one in the div.

 

If you have trouble with css, firefox has some nice tools to check, if it doesnt show the css you put look for errors in your code.

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I just wanna thank you guys for this post...i wanted to do the same thing, have done what you;ve said int he first replies and it worked from the first try

:*

Link to comment
Share on other sites

If you have trouble with css, firefox has some nice tools to check, if it doesnt show the css you put look for errors in your code.

 

 

 

 

Hey that's pretty neat.

 

Do you mean like ; Console2 0.3.9.1 - (https://addons.mozilla.org/en-US/firefox/addon/1815)?

 

It says it not only shows javascript errors but errors in your css as well.

 

Would it identify errors that occur so that it would be cross browser compatible?

Link to comment
Share on other sites

Hey that's pretty neat.

 

Do you mean like ; Console2 0.3.9.1 - (https://addons.mozilla.org/en-US/firefox/addon/1815)?

 

It says it not only shows javascript errors but errors in your css as well.

 

Would it identify errors that occur so that it would be cross browser compatible?

 

 

No, I`m talking about 'Web Developer', I don't believe it would show any cross browser problems.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...