Click here to return to the Wulin.com HTML tutorial column. If you want to browse the CSS tutorial, please click here.
Above: Markup Language - Web Application CSS Style . Chapter 11 Print Style
Previously, in Chapter 10, several methods of applying CSS to documents were discussed. This chapter is about studying the printing style and specifying CSS rules specifically used to print pages. With just a few CSS rules, you can ensure that the effect of printing structured mark content on paper is as good as the one displayed on the screen.
First, let’s take a look at the media types and their relationship with the CSS related to the provision of the device. How to specify the styles used when printing?
Before answering this question, you must be familiar with a concept, that is, we can specify media types for CSS, and declaring media types will enable the style to work for a specific media.
For example, if you want to make a link's style sheet exclusively for computer screens, you can add media attributes to the <link> tag like this:
<link rel=stylesheet type=text/css media=screen href=screenstyles.css />
The previous code can ensure that the style linked to this tag will only be used for computer screens. Maybe you want to ask: In addition to computer screens, which media can be targeted at? The answer is... there are many choices. Media types
In addition to the screen used in the above example, there are many media types to choose from. The following are all recognizable media types, defined by W3C in the CSS2.1 standard (available at http://www.3c.org/TR/CSS21/media.html): all: Braille: Braille: Embossed: Handeld for dot-word tactile feedback devices Handeld: Handeld for handheld devices (usually with small screens, limited bandwidth) print: Pagination content, and document viewing on screen using print preview mode projection: Projection for projection briefings, for example, an anti-aircraft projector, see pagination content (http://www.w3.org/TR/CSS21/page.html) for more information about paging media formats: Mainly suitable for color computer screen speech: suitable for speech synthesizers. Note: CSS2 has a media type with similar functions called aural. Please refer to the appendix of the auditory style sheet (http://www.w3.org/TR/CSS21/aural.html) for more information. tty: Suitable for media using fixed-width text grids (such as telegraph switches, terminals or handheld devices with limited display capabilities). Developers should not use pixel length units in tty. tv: Suitable for TV-type devices (low resolution, low color, limited scrolling capabilities, and sound effects).
This chapter will focus on all, print and screen media types.
Previous page1 2 3 4 5 Next page Read the full text