The media type allows the specified file to be stored in different media. This file can be displayed in different ways on the screen, on paper, in an audible browser, etc.
Media type
Some CSS attributes can only be used for certain media. For example, the property of "voice home" is specially designed for listening users. Other features can be used for different media types. For example, the "font size" attribute can be used for screen and printed media, but may have different values. A file usually requires a large font size on the screen, instead of a file, none. The lined font is easier to read on the screen, while the font of the font is easier to read on paper.
@ Media rules
@ Media rules allow different media styles to be in the same style sheet.
The following example shows the browser that a 14-pixel green font is displayed on the screen. However, if the webpage is printed, it will be a font in 10 pixels. Note that the font width is set to bold, both on the screen and on the file:
<Style>
@ Media screen
{
P. test {font-family: verdana, sans-serif; font-size: 14px}
}
@ Media print
{
P. test {font-family: times, serif; font-size: 10px}
}
@ Media screen, print {p. test {font-weight: bold }}</style> different media types
Note: Media type names are case-insensitive.