• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Difference between these two media queries (max-width, min-width).

Enthusiast ,
May 03, 2019 May 03, 2019

Copy link to clipboard

Copied

Hi,

What is the difference between max-width and min-width in the case below?

@media screen and (max-width: 1024px) { }

@media screen and (min-width: 1024px) { }

Hosun Kang

Tittle was edited by Moderator.

Views

286

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 03, 2019 May 03, 2019

In the 1st  code example, everything under & including 1024px wide  is effected by your style rule.

In the 2nd example,  everything higher than & including 1024 is effected by your style rule. To avoid conflicts, use 1025px in your 2nd media query.

Votes

Translate

Translate
Community Expert ,
May 03, 2019 May 03, 2019

Copy link to clipboard

Copied

LATEST

In the 1st  code example, everything under & including 1024px wide  is effected by your style rule.

In the 2nd example,  everything higher than & including 1024 is effected by your style rule. To avoid conflicts, use 1025px in your 2nd media query.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines