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.

Website Design Forum


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



Freelance Jobs

Reply
How does one go about centering a pages contents within a browser window.
Old 09-05-2006, 12:53 AM How does one go about centering a pages contents within a browser window.
Junior Talker

Posts: 1
Name: Joe
Trades: 0
Hey everybody,

I'm as green as they come to web design so I'm not even sure how silly this question is, but here goes. I've designed a page with Dreamweaver 8 using strictly layers and am frustrated because I'm unable to center the pages contents on a maximized browser window. Is there a simple fix or am I looking at a complete redesign. You can see the site at www.jjewelrydesigns.com to witness this first hand. I've noticed that nearly every page I vist has the capability to expand to fit the browser window and some do what I'm interested in (sort of a floating effect) but when I look at the code I can't find anything that helps.

Thanks for the help, DK
Donkey Kong is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-05-2006, 12:16 PM Re: How does one go about centering a pages contents within a browser window.
Brendan22's Avatar
Extreme Talker

Posts: 202
Name: Brendan
Location: ohio USA
Trades: 0
Looking at your code, i noticed 2 things:

1) Name your divs! "Navigation" or "Top-Menu" or "Content" instead of "Layer18" would make helping you out a whole lot easier..

2) You should take all that inline CSS (everything between <style type="text/css"> and </style>) and move it to an external stylesheet. That way when you make changes, you only have to change the one stylesheet and not every page.

Sorry i didn't answer your question, maybe if no one else tackles it i'll look it over when i get home from work
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Brendan22 is offline
Reply With Quote
View Public Profile Visit Brendan22's homepage!
 
Old 09-05-2006, 03:07 PM Re: How does one go about centering a pages contents within a browser window.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
It's not a silly question, the only silly question is the one you do NOT ask

To center a design with CSS takes a couple of things, but the first thing you need to do is lose all that absolute positioning, it will do nothing but drive you nuts.. and cause other problems.

I would highly recommend this tutorial:
Floatutorial: Step by step CSS float tutorial

..and this reference on css layouts:
Css Layouts - css-discuss

A very basic approach to a centered fixed-width layout:
body{
text-align: center;} - centers for IE

#wrapper{ - a main container for everything else
position: relative;
width: 780px; -- for an 800x600 layout
margin: 0 auto: - centers the container in non-ie browsers
text-align: left;}

Then your html setup would look like:

<body>
<div id="wrapper">
content and other divs go inside this "wrapper"
</div>
</body>

I would also suggest you use an unordered list for your menu and get rid of all those unnecessary divs.
Listutorial: Step by step CSS list tutorial
__________________
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 How does one go about centering a pages contents within a browser window.
 

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