Reply
Centering a web page in the browser
Old 07-17-2006, 06:06 AM Centering a web page in the browser
Super Talker

Posts: 145
Hello,

I would like to ask you how i can center a web page so that if the user resizes the browser to always be at the center.I want the dimension of the site to be width:750 and height:560. I am using a layer and in side that i have the table that include the website.

Could you please tell me how i can do that?

Thank you,
Xenia
xenia is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 07-17-2006, 07:13 AM Re: Centering a web page in the browser
praveen's Avatar
Life is a Dream

Latest Blog Post:
The Best Music
Posts: 3,572
Location: in a distant land far away from reality
for centering a Div element

just set the margin-right and margin-left to auto.

you might also want to add text-align:center (for ie bug)

so the css for the div would look like


Code:
#divname{
margin-right:auto;
margin-left:auto;
text-align:center;
width:750px;
height:560px;
}
also if u content goes beyond 560px it will look ugly.. so u might want to stay away from specifying the height and instead allow the content to define it..

be sure to add text-align:left to other elements like paragraphs, td's etc.. otherwise all your content will be aligned center.
__________________
Praveen
Web Tools - Smilies - Celebs - Bookmarks - Indian Food - Create a Poll

Useful Threads, Tutorials and Resources
Graphics - Templates - Dreamweaver - Javascript - SEO - Ruby on Rails - Ajax Tutorials - More Ajax - CSS - More CSS

Last edited by praveen : 07-17-2006 at 07:15 AM.
praveen is online now
Reply With Quote
View Public Profile Visit praveen's homepage!
 
Reply     « Reply to Centering a web page in the browser
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13285 seconds with 12 queries