Media queries as a replacement for code regions?

I thought it would be a neat idea to put my default CSS, which has no width / height / .. dependencies in a media query like this:

@media only all and (min-width: 0px){ ... }

Are there any flaws that I missed?

+4
source share
2 answers

It is not so clear to be honest with you. If I saw this in a CSS file, I would suggest that this is some kind of weird CSS hack.

Another disadvantage is that you add an unnecessary media request. Setting all of your default attributes through a multimedia query does more work for the CSS compiler.

, . , , . , -, , .

+2

-, -.

- (, IE 7,8,9), . .

:

1. CSS

/******default code******/
html{
..... 
}

body{
.....
}
/****--default code--****/
  1. CSS
  2. IDE

CSS Styleguides

0

Source: https://habr.com/ru/post/1583897/


All Articles