Skip to content
Related Articles

Related Articles

Improve Article

HTML | <style> type Attribute

  • Last Updated : 26 Oct, 2020

The HTML <style> type Attribute is used to specify the MIME type of the <style> Tag. The attribute is used to identify the type of content contained by the <style> Tag.
For ex: The value “text/css” indicates that the content is CSS.

Syntax:

<style type="media_type">

Attribute Values: It contains the value i.e media_type which specify the Internet Media Type of the Stylesheet.

Example: This Example illustrates the use of type attribute in <style> Element.




<!DOCTYPE html>
<html>
  
<head>
    <style type="text/css">
        h1 {
            color: green;
            font-size: 35px;
        }
          
        h2 {
            color: blue;
        }
          
        p {
            color: red;
        }
          
        body {
            text-align: center;
        }
    </style>
</head>
  
<body>
  
    <h1>GeeksForGeeks</h1>
    <h2>HTML Style Type Attribute</h2>
    <p>It is a Computer science portal for Geeks.</p>
  
</body>
  
</html>

Output:

Supported Browsers: The browsers supported by HTML <style> type Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :