T
T
TheStrangeWind2014-03-21 10:19:23
css
TheStrangeWind, 2014-03-21 10:19:23

How to remove an element (image) from the site if the screen width is less than x?

I am doing a responsive design, it is necessary that a certain element is not displayed at a low screen resolution, preferably with the help of css.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Benkovsky, 2014-03-21
@TheStrangeWind

use media query. For example

@media (min-width:900px) and (max-width:1300px) {
   .need-hide{
       display:none;
   }
}

N
nextatix, 2016-04-14
​​@nextatix

solved by adding to css file

@media (max-width:[разрешение экрана]px)
{ [селектор блока]{display:none;} }

if the screen is less than or equal to this width, then the element will not be displayed
for <div id=qwe></div>will be #qwe
for <div class=qwe></div>will be .qwe
for <img src="..." />will be img

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question