Tom Livingston wrote:
> List,
>
> What is the reasons for using:
>
> background: #fff;
>
>
>
> instead of:
>
> background-color: #fff;
>
>
>
> I've seen this lately, and wonder why the preference for the first
> one. I've only used 'background' as shorthand for something like:
>
> background: #fff url(images/image.png) left top no-repeat;
>
> Which is better or more correct?
>   
Background is for HTML markup and is reserved for images, 
background-color is for CSS.

HTML:

<html>
<body background="your_image.jpg">
<h1>Hello world!</h1>
</body>
</html>

To control background color in HTML use bgcolor:

<html>
<body bgcolor="#fff">
<h1>Hello world!</h1>
</body>
</html>

See http://www.w3schools.com/tags/tag_body.asp for a summary of HTML 
attributes for the <body> tag.


CSS:

body {
    background-color:#fff;
}

Bill B


______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to