CSS2 Media Types

Source: Internet
Author: User

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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.