Dynadot Black Friday and Cyber Monday 2026: save more on domains. See our sales.

Css, Need help centering 1024px fixed width in high resolutions

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

igneos

New Member
Impact
0
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
To center any element its parent should have centered text alignment and the element should have auto left and right margins, like so:

Code:
body
{
    text-align: center;
}
#child
{
    margin: 0 auto;
    width: 1000px;
}

:wave:
 
0
Close
As DomainManDave said, just create a wrapper div that contains all your page elements, and set its margins to 0 auto;

Code:
#site-wrapper{ margin:0 auto; }

By the way, why style.php? it should be style.css :)
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back