Question
background:#777777 none repeat scroll 0 0;
the 5 attributes it includes are background-color,background-image,background-repeat,background-attachment and background-position.
My question is:
Are background-repeat,background-attachment and background-position useless if background-image is none? Because according to the document,these are all used to change background-image.
Solution
yes. They have no meaning without that.
OTHER TIPS
You can simply write
background:#777777;
or,
background-color:#777777;
All of those attributes affect the image only.
In general, if a CSS attribute sets multiple values (eg, background
, border
, font
), you don't need to specify all of the values; any values you don't specify will be left at their defaults.
IF you just want a background color, consider using the background-color attribute instead of background.