HTML DOM media attribute

Definition and Usage

The media property sets or returns the device on which the document is displayed.

For style information, the target medium is very important. Styles may be different for mobile devices and desktop computers.

Example

<html>
<head>
<link rel="stylesheet" type="text/css" media="screen"
id="id" href="css.css" />
</head>
<body>

<script type="text/javascript">
x=document.getElementById("id"");
document.write("Intended media type=" + x.media);
</script>

</body>
</html>

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326664074&siteId=291194637