Learn how to implement CSS for background images on webpages

Source: Internet
Author: User

The Background image Background Images has many attributes that can be operated.
Fortunately, you can use background to process all:

The code is as follows: Copy code
Body {
Background: white url (images/bg.gif) no-repeat top right;
}

The following attributes are merged above:
Background-color appears in front.
The location of the background-image.
The format of the background-repeat image is repeated. Repeat can be repeated in the background image, repeat-x is repeated on the x axis (left and right), and repeat-y is repeated on the y axis (up and down, no-repeat is not repeated. Only one repeat is displayed.
You can use top, center, bottom, left, right, or any visible combination of background-position, for example, above.
You can set a background image for most html elements, not just the whole page (body). It can be used to make simple but significant beautification effects, such as rounded corners and other different corner shapes.
It is very easy to use a back image and can be used anywhere on the page. Many people like to use colorful pictures as background pages, which makes it difficult for users to interpret text at the front-end. This is an extreme example, but in fact, most of the texts that are user-friendly and readable are black on the white background or white on the black background (it is recommended that you use soft colors as the background, reduce the glare color)
Therefore, it is best to use the background image either with no content or with a very light background. This will also help reduce the image size, because less color is used. (The index color format, such as GIF, is recommended)

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.