One of the most important features of a style sheet is that it can be applied to multiple media, such as pages, screens, electronic synthesizers, and so on. Certain properties only apply to certain media, for example the "font-size" property only applies to scrollable media types (screens). To declare a media attribute, you can use @import or @media:
Media can also be included in the document markup: SCREEN: refers to the computer screen. Use of mobile-friendly @media style General mobile phone style: @media all and (orientation : portrait) { /*Vertical screen*/ } @media all and (orientation : landscape) { /*Horizontal screen*/ } Specify the height style for mobile phones:
Styles set according to different devices:
Pay attention to the order. If you write @media (min-width: 768px) below, it will be a tragedy, because the CSS file is read from top to bottom, and the latter CSS will have a higher priority.
Because if it is 1440, since 1440>768 then your 1200 will be invalid. So when we use min-width, the smaller one is on top and the larger one is on the bottom. Similarly, if we use max-width, the larger one is on top and the smaller one is on the bottom.
This article ends here |
<<: How to set the text in the select drop-down menu to scroll left and right
>>: About the solution record of the page unresponsiveness when using window.print() in React
Start a new project This article mainly records t...
<br />How can I remove the scroll bar on the...
Table of contents 1.sleep function 2. setTimeout ...
The new project has basically come to an end. It ...
Table of contents Install Dependencies Configurat...
Table of contents this Method In the object Hidde...
Table of contents Preface 1. Key Elements of a Re...
Previously, we all used files with the suffix .ms...
In the vertical direction, you can set the cell a...
The MySQL version number is 5.7.28. Table A has 3...
A mysql-like php switch case statement. select xx...
The layout of text has some formatting requiremen...
The arrangement layout of aligning the two ends o...
Installation Environment Description •System vers...
Introduction to sudo authority delegation su swit...