Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

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
Trades: 0
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
 
 
Register now for full access!
Old 07-17-2006, 07:13 AM Re: Centering a web page in the browser
praveen's Avatar
Life is a Dream

Posts: 3,591
Name: Praveen
Location: Chennai, India
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Last edited by praveen; 07-17-2006 at 07:15 AM..
praveen is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Centering a web page in the browser
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.09692 seconds with 12 queries