1 reply [Last post]
kdough20's picture
New Jersey
Last seen: 6 years 14 weeks ago
New Jersey
Timezone: GMT-4
Joined: 2016-08-24
Posts: 1
Points: 2


I'm making a page and for some reason whenever I preview the page in firefox or aptana the background color keeps showing up as white instead of a dark gray like I wanted it to be. The page is also not center. Am I doing something wrong in my code?

body {
background: #333;
width: 1000px;
margin: 5px auto;


gary.turner's picture
Last seen: 1 year 40 weeks ago
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Not enough info

To properly evaluate the style rules, we need the html it applies against. Two things do merit mention: The body element is not the best element to set width to or center, as it is the overall container for the rendered content. Second, the background property is portmanteau of sorts for all of the background properties. If you're just setting one property, use that specific property, in this case, background-color{}.

Have you used the firebug extension or Firefox's inspect element tool to see just what styles are applied?

Also, be sure to validate your html and css before ever trying to debug a page.



If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.