DEV Community

Cover image for New CSS media queries syntax šŸ’„
Nikola PeriÅ”ić
Nikola PeriÅ”ić

Posted on

New CSS media queries syntax šŸ’„

Say goodbye to Min-Width & Max-WidthšŸ‘‹šŸ»

The new CSS media query syntax revolutionizes how we define responsive breakpoints.

It makes our code cleaner and easier to understand. šŸš€

The benefits of the new syntax:

  • Clarity: The new syntax is simple and intuitive āœØ

  • Efficiency: Reduced complexity leads to faster development šŸŽļø

  • Compatibility: High support across modern browsers. You can check it out here šŸŒ


Code Examples šŸ–„ļø

Traditionally, you might write:

CSS media query

With the new, simpler syntax, it becomes:

CSS media query

Old way:

CSS media query

New way:

CSS media query

You can also test between two widths...

CSS Media query


Conclusion šŸŒŸ

Adopting the new CSS media query syntax will simplify your code. You can focus on creating responsive designs with ease.

Please, comment on your thoughts. Your thoughts are valuable to contribute to the front-end development field. All are welcome! I want to hear them šŸ’¬

Keep up the good work! šŸ‘

Top comments (61)

Collapse
 
kooiinc profile image
KooiInc

Thanks, good to know.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

I'm glad you like it. Make sure to follow me to keep up with more content like this šŸ˜€

Collapse
 
mdrejon profile image
Sydur Rahman

Wow That's awesome .

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Yeah! Thank you for your support :)

Collapse
 
ademagic profile image
Miko

Hah, fantastic :) Strange to think it wasn't always written in this way!

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Haha, exactly!

Collapse
 
temaroon profile image
Aditya

This made it much clear for beginners.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Yeah. It is much more clean now

Collapse
 
divyesh_kakrecha_221ac450 profile image
Divyesh Kakrecha

Thanks for this update.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

No problem amigo! Follow me to stay updated :)

Collapse
 
adhishthanashok profile image
Adhishthan Ashok

Thanks! For the update.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

You're welcome :) Thank you for your support!

Collapse
 
fadekocodeit profile image
Future_Developer

Thanks for sharing šŸ‘

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

You're welcome :)

Collapse
 
damienschneider profile image
Damien Schneider

So much clearer, no one can be against this change. Love this.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Totaly agree :)

Collapse
 
dackd profile image
duck

this syntax is more readable and intuitive

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Agree with you :) Follow me to stay updated

Collapse
 
dfr3sh1 profile image
DFr3sh

Thanks for this tip !

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

You're welcome! Thank you for your support :)

Collapse
 
syedmuhammadaliraza profile image
Syed Muhammad Ali Raza

nice

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Thank you :)

Collapse
 
machineno15 profile image
Tanvir Shaikh

finally they are here.

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Yeah! :)

Collapse
 
e-tech profile image
Onyedikachi Emmanuel Nnadi

nice

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Thank you for your support :)

Collapse
 
webdevop-mudasir profile image
Mudasir Abbas Phulpoto

Well bro, to share latest syntax of css

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Thank you for your support. Follow me to stay updated :)

Collapse
 
anas_alhomsi_bf7397a007e6 profile image
Anas ALhomsi

It is so good and beautiful

Collapse
 
perisicnikola37 profile image
Nikola PeriÅ”ić

Thanks for supporting :) Follow me for more :)