组合CSS媒体查询

我想为打印页面(media = print)的人和在手机上浏览的人显示相同的CSS样式集。有没有办法我可以结合CSS媒体查询

就像是

@media only print or @media only screen and (max-device-width: 480px) {

     #container {
         width: 480px;
     }
}

解决方法

用逗号分隔它们:
@media only print,only screen and (max-device-width: 480px)

See the spec,特别是实施例VI(加重部分):

Several media queries can be combined in a media query list. A
comma-separated list of media queries. If one or more of the media
queries in the comma-separated list are true,the whole list is true,
and otherwise false. In the media queries Syntax,the comma expresses
a logical OR
,while the ‘and’ keyword expresses a logical AND.

我怀疑第二个只需要,所以你可以做:

@media only print,screen and (max-device-width: 480px)

相关文章

Css3如何实现鼠标移上变长特效?(图文+视频)
css3怎么实现鼠标悬停图片时缓慢变大效果?(图文+视频)
jquery如何实现点击网页回到顶部效果?(图文+视频)
css3边框阴影效果怎么做?(图文+视频)
css怎么实现圆角边框和圆形效果?(图文+视频教程)
Css3如何实现旋转移动动画特效