Site Centering

08/01/2009 12:31 damianpesta#1
May I get any help on site centering? I have made a site in PHP , but it seems like it doesnt suit all resolutions.Well I mean that it looks fine on my 22" screen , but once I open it on my laptop its total crap.Any help on doing that?
08/01/2009 12:54 SchnorrerKing#2
just rewrite in a lower resolution? or make a imageless site so u can us it on every solution with a simple script
08/01/2009 13:20 damianpesta#3
Firstivall how do you set a resolution, I am not using any images for my website.But I still have to scroll right when I want to see something on the right side of the website.
08/01/2009 16:43 tribalost#4
Code:
<html>
<head>
<style>
#wrapper { width:1000px; margin: auto; }
</head>
<body>
<div id="wrapper">
&nbsp
</div>
</body>
</hmtl>
You need to set a fixed width for your wrapper element (the div).
Then using margin: auto; will center everything that's inside your wrapper.
08/02/2009 00:39 SchnorrerKing#5
100% works also too so its always fullscreen but u have to check ur site coz most sites are bad and look like crap if they use 100% value
08/02/2009 12:52 Zeelia#6
You can use my stylesheet:
Code:
#menu { float: left; width: 130px; }
#content { float: left; padding-left: 7px; width: 526px; margin-left: 4px; }
I think that's the code which centers MY site, you may have to edit it to fit your site.
It uses a menu to the left and the "content" of the site to the right, use it as:
Code:
<div id="menu">menu here...</div>
<div id="content">page content here</div>
And remember that it uses float so when you want to break it to float another item on your site, you must use:
Code:
clear:both;
Or as i use it:
Code:
.floatbreak { clear:both; }
Some simple CSS knowledge and for the next time, there's a lot of information about this on the web, [Only registered and activated users can see links. Click Here To Register...] :D
//Zeelia