Skip to content

Only show image when user is/isn't on mobile #8218

Answered by kamilkrzyskow
MegAmi24 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @MegAmi24,
you'd use extra CSS with a media query.

/* Hide navigation */
@media screen and (min-width: 76.25em) {
.md-sidebar--primary {
display: none;
}
}

To hide on mobile, the limiter max-width: 45em should probably be fine.
Then add a CSS class to your image with attr_list like .hide-on-mobile
And combine this selector with the media query

.hide-on-mobile {
  display: none;
}

References:

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MegAmi24
Comment options

@kamilkrzyskow
Comment options

Answer selected by MegAmi24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants