CSS implementation nine Gongge image adaptive layout

Source: Internet
Author: User

Before I write nine Gongge adaptive layout, each grid is using Media Finder (@media) or JS dynamic set CSS, according to different phone screen width, suitable for different mobile phones, but this has a great disadvantage, that is mobile screen size too much, you have to write a lot of code, To achieve the effect we want.

Today's whim, the use of pure CSS to achieve the effect I want, below and everyone to share, on the code;

<!        DOCTYPE html>

It includes the simple initialization of CSS, after removal, the actual implementation of the code does not have a few lines.

If we put a picture, then we will change the span tag to an IMG tag, and the CSS will add width:100%;height:100% to IMG;

CSS implementation nine Gongge image adaptive layout

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.