简体   繁体   中英

which CSS query method is the best to use:container query.element query or media query?

I like to know which kind of queries I have to use because this is my first website I am developing and I am working with foundation grid system. I see at this moment you have containers queries which is more targeted to an element . also I see you have element queries and media queries. to have modern responsive website which one I have to use and why? container query,element query or media query? what is your advise to me? thanks johan

The concept of Container Queries is rather new and enables adjusting Elements to the Container, Not Viewport. Container queries would grant you more control over styling in contrast to Media queries but Media queries are largely supported. To use container queries you will need to add extensions. It depends upon how much control does your site require on the responsiveness of its elements.

Do you want to control each and every element of your site individually? Use container queries.

Otherwise go for traditional media queries.

Read here for a more extensive discussion on this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM