Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Centering Masterpages but keeping Conetents alone?

Status
Not open for further replies.

satchi

Programmer
Sep 15, 2003
104
US
Hi, this sounds somewhat trivial but I can't seem to get it right. I have a page that is created via Master/Content pages. There are three tables: header, content, and footer. I want to center the whole page in the center of the screen, but leave the text/pics/etc in the content page un-centered.

I've been trying to add text-align:center to div tags and using css (body tag) where i set the margin to auto, but it's still centering my text within my contents.

Is...there an easy and clean way to do this? Thanks...
 
Hi

yOu can achieve this by enclosing it all in a this

<div align="center">

</div>


ASPNETNEWBIE
 
Firstly, ditch the tables - there's no need for them in this case as they are not supposed to be used for page layout.

Then, create a container div, set it to "margin: 0 auto" in your CSS file (rather than use outdated attributes such as align like in the above example). If you haven't set the text alignment anywhere, it will default to left anyway. You can also style any elements you want within the container by referencing them by class, id or type.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi, thanks for the replies. The <div align="center"> works nicely! Thanks.

I have been reading about using div to do layouts other than table. I'll have to check on that later as I'm currently learning ASP extensively :) . Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top