How to define media type of style tag in HTML5 ?
In this article, we learn how to define the media type of the style tag in HTML5.
Approach: The task can be simply done by using the media attribute of the <style> element. It is used to specify the style is for specific devices like print media or speech. This attribute can accept several values.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
HTML Code: Below code illustrates the media attribute to define the media type of the style tag in HTML5. The below code specifies that styles are for screen and print media devices.
- Screen version output:
- Print version output: