Skip to content

Instantly share code, notes, and snippets.

@dicethedev
Last active November 19, 2022 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dicethedev/f9adf27a919ec24cca89b322e1cd3e1e to your computer and use it in GitHub Desktop.
Save dicethedev/f9adf27a919ec24cca89b322e1cd3e1e to your computer and use it in GitHub Desktop.
Write the CSS code for hiding a div with the class hero only on mobile phone and tablet
/* mobile device */
@media only screen and (max-width:320px) {
.hero {
width: 28%;
display: none;
visibility: hidden;
clear: both;
float: left;
margin: 10px auto 5px 20px;
}
}
/* tablet device */
@media only screen and (min-width: 768px) {
.hero {
width: 28%;
display: none;
visibility: hidden;
clear: both;
float: left;
margin: 10px auto 5px 20px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment