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.

CSS Forum


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



Reply
Setting up layout centrally for any resolution
Old 12-04-2008, 12:40 PM Setting up layout centrally for any resolution
Experienced Talker

Posts: 33
Trades: 0
Hi friends,

I am building my website templates compatible for any resolution ranging from 800x600 to maximum possible resolution. I want to place all the body content exactly in the center (900px layout).

I have set the background exactly in the center. but when i am inserting the content, it is displayed from left. How should i set it in the center?

please help me!
__________________

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

max196 is offline
Reply With Quote
View Public Profile Visit max196's homepage!
 
 
Register now for full access!
Old 12-04-2008, 12:44 PM Re: Setting up layout centrally for any resolution
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Wrap everything in a container div with style="margin: 0 auto;" should work.
Edit: The div should have a fixed width or else it'll be 100% width and you still won't see anything centered. :P
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 12-04-2008, 02:48 PM Re: Setting up layout centrally for any resolution
aldor's Avatar
Ultra Talker

Posts: 479
Name: Alan
Location: Lincoln(UK)
Trades: 0
Read the stickies.
aldor is offline
Reply With Quote
View Public Profile
 
Old 12-04-2008, 03:43 PM Re: Setting up layout centrally for any resolution
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
http://www.webmaster-talk.com/css-fo...r-website.html
__________________
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
 
Old 12-05-2008, 04:00 AM Re: Setting up layout centrally for any resolution
Experienced Talker

Posts: 33
Trades: 0
Thank You very much! LadynRed
__________________

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

max196 is offline
Reply With Quote
View Public Profile Visit max196's homepage!
 
Old 12-05-2008, 08:19 AM Re: Setting up layout centrally for any resolution
Banned

Posts: 12
Trades: 0
Heres a Quick Example on how to Center your Page with CSS.I kinda went far and beyond what you probobly wanted but heres the basics of how to create your text to be centered in a div with a wrapper around it.


Keep in mind - text-align:center;
also centers your text on your page.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body {
background:#ECECEC;
}
#container {
width:100%;
height:100%;
}
#box {
height:350px;
width:350px;
background:#333;
margin:auto;
padding:auto;
color:#fff;
text-align:center;
}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Title goes here</title>
</head>
<body>
     <div id="container">
       
           <div id="box">
    
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
<p>This is some example Text</p>
               </div>
          </div>



</body>
</html>
CSSKid is offline
Reply With Quote
View Public Profile
 
Old 12-05-2008, 11:18 AM Re: Setting up layout centrally for any resolution
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Everything is spelled out in detail in the stickies. The text-align:center isn't necessary unless you're worried about supporting the dinosaur IE 5.5 or older.
__________________
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 Setting up layout centrally for any resolution
 

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