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
Center Align Website with Containment Layer
Old 02-19-2009, 10:24 AM Center Align Website with Containment Layer
Junior Talker

Posts: 1
Name: Maria
Trades: 0
I am nearing completion of a website, and cannot remember the code to center the website in the browser window. I am using layers in Dreamweaver 8, and below is the code that I am using, but the website is still aligned on the left when I preview it. The website size is 800 pixels wide by 600 pixels tall.

In the past I designed a website very similar to the one I am working on now, and I used Layer 0 as a containment layer (so this is what I am trying to do now).

#Layer0 {
position:absolute;
left:50%;
top:50%;
width:800px;
height:600px;
margin-left:-400px;
margin-top:-300px;
z-index:0;
}

Thanks.
maria31412 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-19-2009, 10:42 AM Re: Center Align Website with Containment Layer
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
I usually just set a certain margin amount off the top and do

margin:50px auto;

Just keep the width and height as you have it
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 02-19-2009, 02:26 PM Re: Center Align Website with Containment Layer
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Try reading our stickies: http://www.webmaster-talk.com/css-fo...r-website.html

You really do NOT want position:absolute, that will cause you headaches. If you have everything set that way, better to remove it all and learn to use the normal document flow and floats.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

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


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

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Center Align Website with Containment Layer
 

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