I'm trying to disable a part of my HTML, this code:
<div class="right">
with Media Queries when it gets to a certain screen size, but I'm not sure how to do it. Any suggestions?
Thanks
I'm trying to disable a part of my HTML, this code:
<div class="right">
with Media Queries when it gets to a certain screen size, but I'm not sure how to do it. Any suggestions?
Thanks
If by disable you mean "disappear". Then you can use media queries to make that happen by setting the display
property to none
. Like this:
/* A bit of color */
.right {
height: 200px;
background-color: crimson;
}
/* Hide the <div> with class "right" when the screen width is 600 pixels or lower */
@media (max-width: 600px) {
.right {
display: none;
}
}
<div class="right"></div>
Tip: Click "Run code snippet", then click "full page" and resize the screen of the browser until it disappears.
Learn more about media queries here.