CSS: Media Query


/ Published in: CSS
Save to your folder(s)

This is code you put in a CSS file. It queries the size of the screen using the parameters passed in. If its true, it then applies the CSS


Copy this code and paste it in your HTML
  1. body {
  2. background-color: lightblue;
  3. }
  4.  
  5. @media screen and (min-width: 480px) {
  6. body {
  7. background-color: lightgreen;
  8. }
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.