The background attribute allows the programmer to specify a color or image they want to use for the background of an HTML element.
background属性允许程序员指定要用于HTML元素背景的颜色或图像。
Syntax 语法:
The background attribute is written as style-name{background:attributes}.
背景属性写为样式名{background:attributes}。
The most basic use of the background attribute is to apply a background color and is written as: {background:color}.
background属性最基本的用途是应用背景色,其编写形式为:{background:color}。
A HTML element can also use an image for a background. An image can be used as the entire background or can be repeated in a pattern and is written:
HTML元素还可以使用图像作为背景。图像可以用作整个背景,也可以重复使用并写入:
{background-image:url(‘http://____’) background-repeat:repeat;height:__px;” }