Help centering page in browser

SpaceshipSpaceship
Watch

entrefoto

New Member
Impact
0
I used this command to constrain the size of my website:

<style type="text/css">

#container {
width: 1000px;
height: 600px;
overflow: hidden;
}
.style1 {font-size: 14px}
</style>

I just need to know how to center this page horizontally and vertically in the browser when displayed. Also if I could set the color of the extra area around my constrained site to black that would be awesome too. Thanks in advance for the help!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Code:
[B]html {background:#000;}[/B]

#container {
width: 1000px;
height: 600px;
overflow: hidden;
[B]margin:auto auto;[/B]
}
 
0
•••
There might be vertical scrolling if you have a 600px high box and tabs open.

But to set the page background to black, add this to your css:
Code:
body {
   background: #000000;
}
And then if you want the container to be white, add background: #ffffff; under its properties.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Spaceship
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back