Computer >> Computer tutorials >  >> Programming >> HTML

How do we set what media/device the linked document is optimized for in HTML?


Use the media attribute to specify what media/ device the linked document is optimized for in HTML. The attribute can be used with the following elements − <area>, <a>, <link>, etc.

Example

<html>
   <head>
      <title> HTML media attribute k</title>
      <link rel = 'stylesheet' href = 'style.css' media = "screen" />
   </head>
   <body>
      <p>This is demo text.</p>
   </body>
</html>