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

SpaceshipSpaceship
Watch

igneos

New Member
Impact
0
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
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
•••
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
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Live Options
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back