Bootstrap page layout 5-responsive layout (Format)

Source: Internet
Author: User

The aim is to optimize the page display optimization for different online devices.

  Responsive layout: changes page changes based on the size of the browser window.

Principle: Use Media-queries of CSS to determine the size of the browser window and set some rules in the CSS style sheet!

 

For example:

  Enter the following css3 format implementation in the <style> </style> label:

<Style>

Body {Background: green;} // note that the inline style cannot be written here, and the style can be customized using the CSS style.

    @ Media (max-width: 767px ){Body {Background: Red}} // The Purple part indicates the rule of the elements to be customized.

</Style>

Explanation: The above code is implemented. When the browser window size is smaller than 767px, the style of the body label is set to 12 pixels in font and the background color turns red!

Likewise:

    @ Media (min-width: 767px) {body {Background: yellow }}

    The code above indicates that when the browser window size is greater than 767px, the style of the body label is set to 14 pixels in font, and the background color turns yellow! 

    @ Media (min-width: 767px) and (max-width: 1000px) {body {Background: Blue }}

    The code above indicates that when the browser window size is greater than 767px and less than 1000px, the style of the body label is set to 14 pixels in font and the background color turns blue!

   

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.