문제

I am looking for how to remove specific images with media queries. I am using HTML/CSS for a webpage.

Here is the code I currently have, which does not work (it was experimental):

@media (min-width:0px) and (max-width:1200px) {

LEVEL 1.png, level 6.png, http://placehold.it/160x600, http://placehold.it/100x100 {
display:none;
}

}

Any suggestions would be great, thanks.

도움이 되었습니까?

해결책

Just give the images a class and then in the media query:

.that-class-name {
  display: none;
}

Also, you should probably remove min-width: 0. I'm wondering if something less than 1200px would be better for for max-width as well. That's very wide.

다른 팁

Here you have to add a class inside the your media query

@media (min-width:0px) and (max-width:1200px)
   .img { display: none; margin: 0 auto;} // your image class or can be img tag
}

and just now i answered the same question Here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top