Example of Inline Style

Inline style is used to apply a unique style for a single HTML element.

        
          <h1 style="color: rgb(255, 58, 255)">Example of Inline Style</h1>
        
    

Example of Internal Style

Internal style is used to apply a unique style for a single HTML page.

        
          <style>
            h2 {
              color: rgb(255, 0, 0);
            }

            button {
              color: rgb(255, 255, 255);
              background-color: rgb(0, 0, 0);
            }
          </style>
        
    

Example of External Style

External style is used to apply a unique style for a single HTML page.

        
          <link rel="stylesheet" href="css/style.css" />
        
    
        
            css/style.css

            h3 {
                color: rgb(255, 0, 0);
            }
    
            button {
                color: rgb(255, 255, 255);
                background-color: rgb(0, 0, 0);
            }
        
    

Example of CSS via JavaScript

JavaScript style is used to apply a unique style for a single HTML page.

      
        <p id="js-styled-paragraph">JavaScript style is used to apply a unique style for a single HTML page./p>
        <script>
          document.getElementById("js-styled-paragraph").style.color = "green";
          document.getElementById("js-styled-paragraph").style.fontSize = "18px";
        </script>