CSS intermediate tutorial background image

Source: Internet
Author: User
Using xhtml + css for webpage layout has many attributes related to operations on background images. Most of the images on many performance factors are processed using the background. All attributes of CSS background can be processed.
Body {
Background: white url (images/bg.gif) no-repeat top right;

This is a combination of the following attributes:
Background-color, as we have mentioned earlier.
Background-image: the storage location of the image.
Background-repeat: how to tile images. It can be repeat (the entire page will be tiled), repeat-y (tiled on the y axis, up or down) repeat-x (tiled on the x axis, left and right ), or no-repeat ).
Background-position, which can be top, center, bottom, left, right, or any combination above.
A background image can be used on a vast majority of HTML elements, not just the whole page (body ). It is easy to use but can achieve good results, such as corner shadows.
Note:
It is easy to lose control of the background image and render your webpage everywhere. Some people who are obviously over-active may think that building a colorful image on the background of a page looks cool, but it brings a challenge for users to recognize foreground text. This is an extreme example. In practice, the user interface-friendly readable text is black on the white plain background or white on the black plain background (of course, there is also a suggestion: the beige background or light gray background will be better, because it reduces glare ).
Therefore, the best way to use a background is to use a place without any content, or make the background image lighter, which can also reduce the size of the image file, because there is no more color involved (assuming you are using the index color format, such as GIF ).

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.