HTML Basics Tutorial (--html) background--

Source: Internet
Author: User

The good background makes the site look particularly good.

Instance
Well-matched backgrounds and colors
A good example of background color and text color makes the text in the page easy to read.
Poorly matched backgrounds and colors
A bad example of background color and text color makes the text in the page difficult to read.

(You can find more instances at the bottom of this page.) )

Background (backgrounds)

<body> a label with two configuration backgrounds. Backgrounds can make colors or images.

Background color (Bgcolor)

The background color property sets the background to a color. The property value can be a hexadecimal number, an RGB value, or a color name.

bgcolor="#000000"bgcolor="rgb(0,0,0)"bgcolor="black">

The above code sets the background color to black.

Background (Background)

Background property sets the background as an image. The property value is the URL of the image. If the image size is smaller than the browser window, the image is copied throughout the browser window.

background="clouds.gif"background="http://www.w3school.com.cn/clouds.gif">

The URL can be a relative address, such as the first line of code. You can also make an absolute address, such as the second line of code.

Tip: If you're going to use a background image, you need to remember a few things:

    • Whether the background image increases the load time of the page. Tip: Image files should not exceed 10k.
    • Whether the background image matches the other images on the page.
    • Whether the background image matches the text color in the page.
    • Does the image look OK when it's tiled in the page?
    • is the attention to the text distracting by the background image?
Basic considerations-Helpful tips:

The background color (bgcolor), background (background), and text properties in the <body> tag have been deprecated in the latest HTML standards (HTML4 and XHTML). These attributes have been removed by the consortium in their recommendation criteria.

You should use cascading style sheets (CSS) to define the layout and display properties of HTML elements.

More examples
Strong usability Background Image
Examples of background images and text colors make page text easy to read.
Strong usability Background Image 2
Another example of background image and text color makes page text easy to read.
Poor usability background image
examples of background images and text colors that make page text difficult to read.

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.