How does HTML add a background image and let the picture tile the entire page? (code example)

Source: Internet
Author: User
Tags set background
Some site pages if you add a good-looking background image is more noticeable, but how do we do the background image of the page set it? It is also often required to display the HTML background image tiling. This should not be difficult for a friend who knows a little bit about html/css knowledge. So this article is mainly for the novice friends, to detail the HTML background map to add the use of methods. Can be for everyone's reference.

One, the HTML background map horizontal tiling code example:

<style type= "Text/css" >    body{        font-size:12px;        font-family: "Song body";        Background-image:url (2.png);        Background-repeat:repeat-x;        COLOR: #0C2B30;    } </style>

Effects such as:

Two, HTML background map Portrait Tile code example:

    body{        font-size:12px;        font-family: "Song body";        Background-image:url (2.png);        Background-repeat:repeat-x;        COLOR: #0C2B30;    }

Effects such as:

Three, the HTML picture full screen code example:

html,body{    width:100%;    height:100%;}. mui-content{    Background:url (2.png) bottom center no-repeat #efeff4;    background-size:100% 100%;    width:100%;    height:100%;}

Effects such as:

So the above gives you a summary of how to let HTML set background image, HTML background tile and other related knowledge. Hope to be helpful to the needy friend.

Note:

The background shorthand property sets all the background properties in a declaration.

The Background-size property specifies the size of the background image.

The Background-repeat property sets whether and how the background image is repeated. The default background image repeats in both horizontal and vertical directions.

The Background-image property sets the background image for the element.

The background of an element occupies the full dimensions of the element, including padding and borders, but excluding margins. By default, the background image is in the upper-left corner of the element and repeats in both horizontal and vertical directions.

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.