How to specify media type of the target URL in HTML5 ?
You can easily specify the media type of the target URL in HTML5 using the media attribute of HTML. This attribute is used to specify that the target URL is designed for special devices (like iPhone, Android, etc), speech or print media, projectors, tv, and so on.
<a href="" media="screen" target=”_blank”> Click here</a>
Note: The media attribute can only be used if the href attribute is used as it specifies the linked document. The media attribute is used to specify how and in which devices the linked document would appear and be compatible.
Various devices values:
- all : It is most suited for all media-type devices.
- screen : It is used for computer screens, smartphones, etc.
- tv : It is used for television-type devices (low resolution, or the one with limited scroll ability).
- print : It is used for the print preview mode/printed page’s mode.