NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page CSS Alignment problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-20-2004, 05:30 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: May 2004
Posts: 316
wistow is an unknown quantity at this point
 



CSS Alignment problem


Hi
????: NamePros.com http://www.namepros.com/programming/31200-css-alignment-problem.html

I have been using css since last sunday, and I have learnt it pretty quick.

The problem I am having is that I have a website layout where the content is in a fixed sized layer of 754 pixels. When designing on my monitor which is 1024x768 i give it a 12% indent from the left side of the page and it looks fine as it is centrally aligned, BUT when I test it in 800x600 mode it is all aligned to the right of the page and I am wanting it aligned in the centre of the page on both resolutions.

Do you have any ideas how I could do this? If it is very obvious i am sorry but remember i'm just a newbie!

Kind Regards,

Craig Wistow
HitSnapper.com
wistow is offline  
Old 05-21-2004, 12:35 PM   #2 (permalink)
New Member
Join Date: May 2004
Posts: 4
radka is an unknown quantity at this point
 



I am new to css too, but the way I center the layer is:

#layer {
position:absolute;
left:50%;
width:754px;
margin-left: -377px; }

position left:50% will align the left side of your layer with the center of any browser window and margin left (377 is half of your layer width) will move the left side -377 px to the left from the center. That way your layer will be always centered.

Good luck, hope it will help

Radka
radka is offline  
Old 05-21-2004, 12:41 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: May 2004
Posts: 316
wistow is an unknown quantity at this point
 



Thanks, that would work, but I cured the problem this morning

Thanks for the help though!

Kind Regards,

Craig
__________________
UK Deal Finder
wistow is offline  
Old 05-21-2004, 12:49 PM   #4 (permalink)
New Member
Join Date: May 2004
Posts: 4
radka is an unknown quantity at this point
 



Did you find different solution?

Radka
radka is offline  
Old 05-21-2004, 01:02 PM THREAD STARTER               #5 (permalink)
NamePros Regular
Join Date: May 2004
Posts: 316
wistow is an unknown quantity at this point
 



Yes i used the following:

body{
text-align-center; background-color: #cccccc
}

#header{
width: 754px;
text-align: left;
margin-left: auto;
margin-right: auto;
}

Kind Regards,

Craig
__________________
UK Deal Finder
wistow is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:23 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger