What does media=“screen” mean in css?

若如初见. 提交于 2019-12-21 12:07:23

问题


What does media="screen" mean in the below css code?

<style type="text/css" media="screen">

回答1:


The goal of the media attribute is to allow you to specify different styles for different methods of display.

Most commonly I use this to have 2 sets of styles, 1 for display (screen) and 1 for printing (print)

Normally on the "print" css I'll do things like hide buttons, strip out extraneous images, ads, etc etc. Basically, make it 8.5x11 friendly.




回答2:


There are two types, screen is the default browser view. print is for print view.




回答3:


In addition to Brook's answer, the media="foo" attribute of the is equivilant to the @media foo in your CSS file



来源:https://stackoverflow.com/questions/4523865/what-does-media-screen-mean-in-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!