General mobile phone style:
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.
Attach a small example
It can be seen that the navigation bar above changes with the change of screen size, and finally all the items in the navigation bar are moved to a button in the upper right corner. The main syntax to note is: 1. @media (max-width: 768 px) { The above is all the content about how to use @media mobile adaptive style. I hope it will be helpful for everyone’s learning and solving problems. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Analyze several common solutions to MySQL exceptions
>>: gbk utf8 How to choose to correctly understand and use GBK and UTF-8 web page encoding
The warehouse created using the official Docker R...
question After Nginx reverse proxy, the Tomcat ap...
Without further ado, I will post the code for you...
Table of contents 1. Download the MySQL installat...
Native js encapsulated seamless carousel plug-in,...
This article introduces the sample code of CSS to...
background Recently, some friends who are new to ...
Generally, during Qingming Festival, the National...
The so-called favicon, which is the abbreviation o...
Table of contents Preface Motivation for Fragment...
Table of contents 1. Object 1.1 What is an object...
The ps command in Linux is the abbreviation of Pr...
Without further ado, let’s run the screenshot dir...
There are some problems with the compressed versi...
First, let’s take a look at the picture: Today we...