Horje

How to add print Value in HTML <source> media Attribute

print Print preview mode/printed pages
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The source media attribute</h1>

<picture>
  <source media="screen not (min-width:500px)" srcset="https://horje.com/avatar.png">
  <source media="print and (min-width:500px)" srcset="https://horje.com/avatar.png">
  <img src="https://horje.com/avatar.png" alt="Horje Icon" style="width:auto;">
</picture>

</body>
</html>

Output should be:

How to add print Value in HTML <source> media Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin