Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the reason for the invalidation of using media query @ meda in html

Shulou Source: shulou.com Published: 2022-05-31 12:48:04 11月17日 Update

Today, I would like to share with you the relevant knowledge about the reasons for the invalidation of media query @ meda in html. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1. The question of priority

Div p {color:#333;} @ media screen and (min-width:500px) and (max-width:1240px) {p {color:#666;}}

The p tag in the above code div does not change color, because the text color of the p tag specified in the media query takes precedence over the color specified in div.

2. Space character problem

@ meida screen and (max-width:768px) {.}

Note that when writing media queries, you must remember that there is a space before and after and, otherwise it will become invalid!

3. Note whether the meta element is declared or not

The mobile side must declare, but the pc side does not require it.

These are all the contents of this article entitled "what is the reason for the failure of media query @ meda in html". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Media query knowledge article color reason priority content tag question different big middle finger code element most that is text time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology MySQL macOS OPPO Reno