Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How CSS controls the print style of web pages

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how CSS controls the print style of web pages. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

CSS controls the print style of web pages:

Using CSS to control the print style, the grip was a mess when I first used it. I had no idea what the role of midia in CSS was. I was foolishly at a loss when I asked others to import this style. If you have the same phenomenon, then I'll tell you, look up the role of CSS's midia in W3school.

Definition and usage of midia:

The media attribute specifies the device on which the linked document will be displayed.

The media attribute is used to specify different styles for different media types.

Media was originally used to specify the media type of css, and its syntax formats are as follows:

@ media screen | print | projection | braille | aural | tv | handheld | all

Parameter description:

Screen: a computer screen.

Print: refers to the opaque media used for printers.

Projection: refers to the item used for display.

Braille: Braille system, which refers to printed matter with tactile effect.

Aural: refers to the speech electronic synthesizer.

Tv: TV type of media.

Handheld: refers to a handheld display device.

All: for all media.

As long as the import adds something you don't want to print to the following CSS style declaration, it will not appear on the printed page:

The code is as follows:

For example:

The code is as follows:

/ / midia must be declared, otherwise it will be invalid

# my_hidden {display:none;}

The above is all the contents of the article "how CSS controls the print style of web pages". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report