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
Intro Previously, our docker images were stored i...
Type yum install mysql-server Press Y to continue...
With the continuous development of the Internet ec...
Here's a solution to the problem where margin...
Table of contents Overview 1. Path module 2. Unti...
HTML has attempted to move away from presentation...
1. Linux network configuration Before configuring...
When the front-end and back-end interact, sometim...
First go to the official website to download and ...
Project requirements require some preprocessing o...
MySQL implements Oracle-like sequences Oracle gen...
This article shares the specific code of making a...
Table of contents In the React official website, ...
Jenkins configuration of user role permissions re...
Usage scenario: We use Alibaba Cloud and purchase...