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
This article mainly introduces an example of how ...
1. Preparation before installation 1. Download th...
Table of contents 1. Preliminary preparation 1.1 ...
Antd+react+webpack is often the standard combinat...
If this is the first time you install MySQL on yo...
Hyperf official website Hyperf official documenta...
Table of contents 1. Description of functions in ...
This article example shares the specific code of ...
Nowadays, tabs are widely used in web design, but...
Table of contents How to operate Operation proces...
In today's development environment, fast is b...
1. Error error connecting to master 'x@xxxx:x...
<br />This tag is used to create a multi-lin...
1. Update the yum source The PostgreSQL version o...
Querying the database SELECT * FROM `student` Que...