0

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.

  • 2
    Look 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 Answers1

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