I want to make css grid appear on a phone version but i want only basic css with flexbox appear on desktop version.My website will be mobile first because its gonna be image gallery.
Asked
Active
Viewed 227 times
0
-
2Look at CSS media queries: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries – dwjohnston Feb 01 '19 at 11:18
-
Possible duplicate of [Responsive css styles on mobile devices ONLY](https://stackoverflow.com/questions/15061520/responsive-css-styles-on-mobile-devices-only) – Martijn Feb 01 '19 at 11:20
-
You can google it with this query: "css mobile only" – Martijn Feb 01 '19 at 11:20
1 Answers
0
You can use a media query, such as :
// will be applied by default
.element {
display: grid;
}
// will overwrite the display when the screen has a larger width than 768px
@media (min-width: 768px) {
.element{
display: flex;
}
}

Marine Le Borgne
- 1,036
- 2
- 11
- 39