-
@media screen and (max-width:600;){ img {margin:0px;} }
-
@media screen and (max-width:600px){ #img {margin:0px;} }
-
@media screen and (max-width:600px){ img {margin:0px;} }
-
@media screen and (min-width:600px){ img {margin:0px;} }
EXPLANATION
img is an HTML tag, so it is referred to without any
prefix. #img would be an ID, which can only refer to a single item, so
would not be suitable here. (In practice we might use a class though.)
max-width will apply the conditional css to screens of less than the stated width.
min-width would affect only larger screens, which is not what we want.
Nasty gotcha:
(max-width:600;) is
invalid syntax. Although this looks like a standard css statement, it
is actually a special comparison clause. It must not be terminated with a
semicolon. (Trailing semicolons are optional on single css statements,
but for some obscure reason are not allowed here.)
SOURCE
https://www.w3schools.com/cssref/css3_pr_mediaquery.asp