如何指定一组 CSS 规则的目标媒体类型

cssweb developmentfront end technology更新于 2025/9/9 6:04:17

Link 元素上的 media 属性指定外部样式表的目标媒体 −

示例

<style>

   <!--
      <!doctype html public "-//w3c//dtd html 4.0//en">

      <html>

         <head>
            <title>link to a target medium</title>
            <link rel="stylesheet" type="text/css" media="print, handheld" href="foo.css">
         </head>

         <body>
            <p>the body...
         </body>

      </html>
   -->
</style>

相关文章


有用资源