Check out example codes for "media query in html style". It will help you in understanding the concepts better.

Code Example 1

span { background-image: url(particular_ad.png); }

@media (max-width: 300px) {
    span { background-image: url(particular_ad_small.png); }
}

Code Example 2

@media only screen and (max-width: 600px) {
  body {

   
background-color: lightblue;
  }
}

Learn ReactJs, React Native from akashmittal.com