Element queries instead of media queries? · Links

Mobilism 2015, Beyond Borders, Beyond Mobile

Mobilism 2015 is over

8 April 2013 · PPK

Good idea in principle: element queries.

.element (max-width: 500px) {
// styles in case the element is 500px or less wide

Problem is: at the time the CSS is parsed you may not know the element's width, or its parent's width yet, while the page width we use in standard media queries is known. So although I agree in principle that this is a good idea, it's probably very hard to implement.

Read more: http://ianstormtaylor.com/media-queries-are-a-hack/