Background Image Adaptive resolution browser size auto stretch full Screen code

Source: Internet
Author: User

 <  div  id  = "WEB_BG"   style  = "Position:absolute; width:100%; height:100%; z-index:-1"  >  <  img  style  = "position:fixed;"   src  = "Http://a.lanyes.org/bg1.jpg"   height  = "100%"   = "100%"  />  </ div  >  

In the production page CSS style, a good-looking effect background image is indispensable, in order to consider that each guest user's resolution size is not the same, we will choose to use the color code can be tiled or small image as the background, then how to make a large picture of high-definition as the background, Regardless of the resolution size of the guest user, will automatically stretch the display, starting for this problem I also distress, in the online tour of a circle of friends, from which to get the background image to adapt to the browser window size and automatically stretched code, share to the need of friends, just copy the following code to the page <body > tags below can be implemented, of course, if your large map into the space inside the download is very slow, you can put the picture in the Baidu Development center Bae inside, as I stand now these big pictures are placed in Bae inside the escrow. If you use this code, remove the background style from the body tag in the CSS style, and this effect does not support the IE6 browser.

Background Image Adaptive resolution browser size auto stretch full Screen code

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.