By techguy10 on
I know that this isn't that hard to do with regular css but sometimes things seem to get messed up when dealing with the page.tpl.php file when I put do things that make perfect sense to me, anyways I would appreciate if someone could instruct on what you need to do in a drupal css theme to make it always stay centered, I did a search on this but nothing came up which I'm guessing is due to the search function on this site not being the greatest.
Comments
Not sure how much CSS skills
Not sure how much CSS skills you have but to basically centre your page, use:
NOTE: .wrapper CSS class is the one that surrounds your actual content page. You could call it anything else you want but make sure you had that to your page.tpl.php file and the code above to your style.css file. Don't forget to change the width=960px to whatever your width is for your main page.
I think the search on Drupal.org works quite well considering how much information there is. Maybe, try better keywords next time.
Hope that helps.
---------- Personal Blog | tutorials | photogaphy -----------
Freelance web designer/developer: duvien.com
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
Start by creating the html
Start by creating the html like this (body only shown)
You can set the width as desired, the important part is the left and right margins need to be set to auto.
If on the otherhand you want the content width to vary but still want "space" on either side I think something like this will work.
This time it is important to set the left and right margins to the same value (here we use 10%). It can be a relative value like 10% or even a fixed value like 100px.