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
Table of contents getting Started Data storage Co...
It is very easy to delete data and tables in MySQ...
summary: The following is a method for changing t...
Hello everyone, today I will share with you the i...
1. Virtual Machine Side 1. Find the mysql configu...
Table of contents 1: Encapsulation idea 2. Packag...
Table of contents EffectList Collection EffectLis...
1. What is responsive design? Responsive design i...
The following information is compiled from the Int...
Anaconda refers to an open source Python distribu...
Recently, https has been enabled on the mobile ph...
Understanding of diff algorithm in React diff alg...
Preface When Ahhang was developing the Springboot...
Table of contents Create a simple springboot proj...
Table of contents Written in front Precautions De...