background (HTML attribute)
background attribute is used to display a
background image on the web page. It’s not possible to specify how the
image is to be displayed (for example, you can’t specify it to be
centered, non-repeating, or aligned to a specific edge of the document);
it will simply be repeated along both the x and y axes.
Because of this, most web pages to which this technique is applied either
display the background as small, repeated images, or use huge images to
avoid tiling repetition.
This attribute is now deprecated.
Background images should instead be specified using the CSS
background-image properties. These offer far more
flexibility, allowing the author to define whether the image should be
repeated on the x or y axis, along both axes, or not at
all; it’s also possible to position the image relative to any of the
This code applies a sandy theme to the page:
<body background="sandy.jpg"> ⋮ </body>
This attribute takes as its value
the location of the image relative to the referencing document, relative
to the server root, or as a complete URI containing the
http:// protocol, the server name, and the path to the
document on that server.
Every browser listed supports this attribute.
There are no comments yet.