Unstoppable Domains โ€” Expired Auctions

CSS Alignment problem

SpaceshipSpaceship
Watch

wistow

Established Member
Impact
0
Hi

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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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
 
0
•••
Thanks, that would work, but I cured the problem this morning :)

Thanks for the help though!

Kind Regards,

Craig
 
0
•••
Did you find different solution?

Radka
 
0
•••
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
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back