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

Hello!

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
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 hours 35 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9738
Points: 3817

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.

cheers,

gary

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