The first chapter of the media Quer of responsive design

Source: Internet
Author: User

The book talks about trying not to use media queriy. But using media query too much can cause the CSS to become brittle and the page difficult to maintain. Some ways to reduce the page use media query.

Responsive design:

(1) Replace the fixed width with a percentage. If not, use VW, VH, Vmin, Vmax as much as possible.

(2) Use the max-width without using width.

(3) for some elements, such as IMG, object, video, iframe, use max-width:100%.

(4) If the background picture is to completely cover the container, you can use background-size:cover.

(5) When you want to lay out pictures or other elements in the rows and columns of a table, you can use the Flexbox layout or the display:inline-block.

(6) When using multi-column text, replace Column-count with Column-width

Summary: use flow layout and relative size as much as possible.

(More on Flexbox layout, and CSS3 properties)

The first chapter of the media Quer of responsive design

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.