Home  >  Article  >  Web Front-end  >  css background属性_html/css_WEB-ITnose

css background属性_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:531133browse

Background shorthand property sets all background properties in one declaration.

All browsers support the background attribute.

Note: IE8 and earlier browsers do not support multiple background images for one element.

Note: IE7 and earlier browsers do not support "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".

can set the following attributes:
?background-color
?background-position
?background-size
?background-repeat
?background-origin
? background-clip
?background-attachment
?background-image

If you don’t set one of the values, there will be no problem, such as background:#ff0000 url('smiley.gif' ); is also allowed.

It is generally recommended to use this attribute instead of using individual attributes individually, as it is better supported in older browsers and requires fewer letters to be typed.

Example:
body
{
background: #00FF00 url(bgimage.gif) no-repeat fixed top;
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn