In addition to being able to specify various style sheets based on the media width, you can specify within a stylesheet specific parameters based on width conditions. As will be discussed below, this latter technique can increase performance, as your page will rely on fewer stylesheets, thereby reducing the number of resources that must be loaded.
To write a media query within your css stylesheets, you will include the following;
@media "media conditions" {
/* CSS Rules */
/* Typed Normally */
}
You would replace the “media conditions” with your actual media query conditional check. So;
screen and (min-width:800px)
(max-width:450px)
So, for example, the following would set the text color to green, when the screen size is larger than 600 pixels.
NOTE: How the css rule looks exactly the same is usual within the media query.
@media (min-width:600px) {
body {
color: #00ff00;
}
}
NOTE: Remember, that you will ignore the “write your code in here request”.