-4

how can i remove all content of a div if the webpage is only X px width i am searching for something like this

 <div if(min-width:1000)
{content=''}>
<img>
<script>
....
</script>
</div>

Thank you for your answers

  • 1
    read about media queries. Basically a way to apply css depending on screen size. Then css `display: none` will do the trick of removing the element. – mikepa88 Jun 27 '17 at 14:01
  • 3
    use media queries – mumair Jun 27 '17 at 14:01
  • Please don't use snippets for pseudo code (try clicking on Run code snippet and see what happens). – Heretic Monkey Jun 27 '17 at 14:01
  • Welcome the the internet. May I suggest you discover the wonderful world of **Search Engines**!! Next time try searching out your question. I searched your exact title and found at least 5 answer in 5 seconds. – gforce301 Jun 27 '17 at 14:04
  • media query is the best solution. Also, have look to bootstrap. – Prince Sodhi Jun 27 '17 at 14:06

1 Answers1

0

You can use media query to achieve this.

@media screen and (max-width: 1000px){        
    div{
       display: none;
    }
}

The above css snippet will hide the div if the width is less the 1000px.

Arun
  • 378
  • 1
  • 11