The CSS background attribute "Background" provides many attribute values, such as color, image, positioning, etc., which provides a great convenience for the definition of Web page background image. Look at the property values provided by background:
From the name of the attribute value can be very clear to see, is: color, image, layout, scrolling, positioning, where background-repeat, background-position must be in the specified Background-image attribute value only valid.
background-color:transparent | Color. "Transparent" is the default property value for Background-color (the red Word indicates the default value), meaning the background color is transparent, that is, no background color, and "color" refers to the color, can be HTML language support English words, can also be hexadecimal color values, Of course, it is recommended to use hexadecimal color values, such as black using "#000."
Background-image:none | URL. The default property value is a no background image, which you need to import using a background map.
Background-repeat:repeat | No-repeat | Repeat-x | Repeat-y. The default property value is that the background image is tiled vertically and horizontally, using "no-repeat" if you do not want the image to be tiled but with a complete lining, and the same principle is tiled horizontally using the "repeat-x" tile using "repeat-y".
Background-attachment:scroll | Fixed. "Scroll" is the background image with the content scrolling, "fixed" is the background image fixed.
Background-position:position (length) | Position (length). The background image position of an object can be selected in two ways, one using position (top | Center | NRC | Left | Center | right) to position the background image, the other way is to use Lefgth (numerical) to locate, the use of numerical value should be noted that when there is only a numerical value, which will be used for the horizontal axis, the ordinate will default is 50%, if there are two values, the horizontal axis, ordinate.
After understanding and familiar with the above background attributes and attribute values, it is easy to make appropriate processing for the background image of the Web page. But here's a trick: after defining the Background-image attribute, you should define a Background-color value that is similar to the color of the background image, so that when the slow speed background image is not loaded or the background image is lost, can still provide good text recognition. For example, the background image is a black bottom map, then the color of the text will naturally choose a light tone or even white, if the background image is not loaded or the image is lost, then you need to define a black background color, you can keep the text of the recognition.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.