Types of CSS

There are three ways to include CSS in HTML.

  • Inline CSS

  • Embedded or internal CSS

  • External CSS

Inline CSS:

By using style attribute CSS with the HTML page.

Ex.

        <h1 style="color:blue; font-size:50px;">This is a head section</h1>

 

Embedded or internal CSS:

Using style attribute inside the head section of HTML Page.

Ex.

     <head>

                    <title>My HTML Document</title>

                        <style type="text/css">

                                 body { background-color: Blue; }

                                  p { color: #fff; }

                         </style>

        </head>

External CSS:

In this create new file style.css and link to HTML page by link.

Ex.

        body {

                   background: blue;

                   font: 14px Arial, sans-serif;

                  }

        h1 {

                color: white;

              }

Powered  by Codersarts