I am trying to center a page created with css in the middle of the screen. The way you can with tables or frames.
I am not talking about centering a single paragraph or element but rather the whole page. It sounds easy but has defeated me up to now.
Thanks for any help.
Simply use the DIV element around anything you want centered:
So in your case, you would probably just want to include everything on your page within a div tag like:
Good luck! :D
OR...if you are already using a master TABLE around your content, just put align="center" in the TABLE tag.
Where do I go?
I need help with cascading style sheets, where can I go to learn the basics. And give me a break if this is a dumb question... I'm only doing this for fun :devil: , but I could use some help, I enjoy designing and I want to know how to get better!! ;) !!
J. Pederson - Here are some sites:
- Kevin Yank's article @ SitePoint
- Project Cool's CSS1 Referncce
- Webmonkey's Index on CSS
- Google's Searchresults
I don't know many HTML Tutorial sites, but those are the ones I do know, other Mentors and Advisors probably have a longer list, hope it helps :)
What you say is true except that I have used a lot of absolute positioning to get things just where I want them. These absolute divs don't seem to be affected by the align center wrapped around them.
In the following example the column always stays on the left.
Maybe the problem is using absolute positioning but how else do I get things where theyshould be?
Creole: The same applies to tables. Absolute divs ignore everything.
Thanks both of you and maybe you have a better idea.
<div style="position: absolute; top: 10px; left: 10px; width: 150px; height: 1000px; background-color: #336601;">
I was afraid you were going to say that. I actually thought about mentioning that in my previous post but I figured I'd take the easy route.
Basically, since you're abpos'ing everything, you've got two choices.
1) Leave the site the way it is, left-aligned.
2) Recode the site and use relative positioning.
Those are your only choices.