CSS controls the Print Style

Source: Internet
Author: User

CSS controls the Print Style

 

<Link href = "/skin/print.css" rel = "stylesheet" type = "text/CSS" Media = "print"/>

 

This is the code for importing external CSS files, and the sample application is in the preview mode. The print.css file used by this Code does not work when the webpage is browsed normally. It will be used only when the page is printed. Link is an HTML Tag that imports external files. Href is the path of the imported file. The rel defines the relationship between the document and the link. The value "stylesheet" is the type of the file imported for the type of the external style table, and the value "text/CSS" is the CSS file. Media media type. The default value is screen (computer screen ). The value "print" indicates the print preview mode.

 

 

Print CSS can be defined in the following ways: 1. <LINK rel = "stylesheet" href = "/themes/canbeing/style/print.css" type = "text/CSS" Media = "print"/> 2. @ import URL ("print.css") screen; 3. @ Media Print {body {font-size: 12px ;}} 4. <style media = "print"> body {font-size: 12px;} </style> In fact, print is a media attribute of stylesheet, the style sheet has eight media attributes: All For all output devices Braille for Braille tactile feedback device embossed for paging Braille printer handheld intended for handheld devices (usually small screens with limited bandwidth) print for printer preview and print projectio N for projector screen (default) for color computer screen speech for speech synthesizer, css2 also has similar media type (aural) tty to be used for fixed width (such as telex typewriter, dock, or a portable device with limited display capabilities. TV is used for TV devices (low resolution, color, limited scrolling screen, audio available)

 

 

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.