Adds a background image to an element of the page, which cannot be displayed when no specific width is specified.
1. Add a background map
HTML code:
<! Doctype html>
We can look at the page effect:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/88/9F/wKioL1f9ylvzmxMTAADJxXOldE8339.png "title=" Qq20161012132420.png "alt=" Wkiol1f9ylvzmxmtaadjxxolde8339.png "/>
In order to adapt to different terminals of the screen size, we can not write the width of the dead, how to do? You can take the following methods:
HTML code:
<! Doctype html>
Take a look at the page effect:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/88/A2/wKiom1f9zCPiOQU2AAZSjvpld9s826.png "title=" Qq20161012133716.png "alt=" Wkiom1f9zcpioqu2aazsjvpld9s826.png "/>
2. Add a background image via the IMG tag
HTML code:
<! DOCTYPE html>
When I look at the page effect, we find that the picture is rendered in hundred percent actual size, which is obviously not the effect we want.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/88/A2/wKiom1f9znviloL-AAO-QmFQJMM207.png "title=" Qq20161012134338.png "alt=" Wkiom1f9znvilol-aao-qmfqjmm207.png "/>
Very similar to the example above, we just need a little modification.
HTML code:
<! Doctype html>
Viewing page effects under different analog models can be achieved by:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/88/9F/wKioL1f9zxjiF2ogAAUHsnaVZnQ304.png "title=" Qq20161012134956.png "alt=" Wkiol1f9zxjif2ogaauhsnavznq304.png "/>
About the Background-size attribute, which is defined by the
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/88/A2/wKiom1f90BiRD1xuAAC870PTnOY152.png "title=" Qq20161012135256.png "alt=" Wkiom1f90bird1xuaac870ptnoy152.png "/>
You can view the link in detail: http://www.w3school.com.cn/cssref/pr_background-size.asp
This article is from the "Dapengtalk" blog, make sure to keep this source http://dapengtalk.blog.51cto.com/11549574/1861053
CSS adds a background image to unknown, wide-height elements