OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Make a DIV disappear when it reaches a certain width WITHOUT JavaScript [closed]

  • Thread starter Thread starter Brian Winter
  • Start date Start date
B

Brian Winter

Guest
This is a CSS-only problem, no JavaScript allowed.

I have a DIV that when it reaches a certain width, it should disappear. @media (max-width: 1024px) {} works for the normal cases as the browser resizes.

BUT.....

There are screens that have a pop-open side panels that will squeeze the DIV into the left-half of the screen. In this situation, I'd like the DIV to also disappear just like the @media condition above. When the panel closes, the DIV should reappear normally.

I've tried DIV within a DIV, different display property types in combo with overflow, flex, and, of course, various @media settings.
<p>This is a CSS-only problem, no JavaScript allowed.</p>
<p>I have a DIV that when it reaches a certain width, it should disappear. @media (max-width: 1024px) {} works for the normal cases as the browser resizes.</p>
<p>BUT.....</p>
<p>There are screens that have a pop-open side panels that will squeeze the DIV into the left-half of the screen. In this situation, I'd like the DIV to also disappear just like the @media condition above. When the panel closes, the DIV should reappear normally.</p>
<p>I've tried DIV within a DIV, different display property types in combo with overflow, flex, and, of course, various @media settings.</p>
Continue reading...
 
Top