How do i make a div/image disappear when the screen reaches a certain width using media queries?
Disappear how?
Remove it from the DOM or just hide it?
I don't think he means removing from the DOM. Anyway, that couldn't be done. But you could hide it.
@media (max-width: 40em) { .element { display: none; } }
I don't think he means removing from the DOM. Anyway, that couldn't be done
With JS you could...couldn't you?
@media (max-width: 40em) { img { visibility:hidden; } } also works...you can simply give the width...here "max-width" means devices less than width of or equal to...
display:none
is not the same as
visibility:none
http://codepen.io/Paulie-D/pen/39b45717797e5d4068d87de01c949386
That would be too easy.
Very easily, but that would require JS to do something you could (and have to) do with CSS only (Media Queries).
@Paulie_D : got it! thanks :(
How do i make a div/image disappear when the screen reaches a certain width using media queries?
Disappear how?
Remove it from the DOM or just hide it?
I don't think he means removing from the DOM. Anyway, that couldn't be done. But you could hide it.
With JS you could...couldn't you?
@media (max-width: 40em) { img { visibility:hidden; } } also works...you can simply give the width...here "max-width" means devices less than width of or equal to...
is not the same as
http://codepen.io/Paulie-D/pen/39b45717797e5d4068d87de01c949386
That would be too easy.
Very easily, but that would require JS to do something you could (and have to) do with CSS only (Media Queries).
@Paulie_D : got it! thanks :(