CSS Inline Style



What is Inline Style ?

  1. Inline styles are styles that are written directly in the tag on the document.
  2. Inline styles affect only the tag they are applied to.
  3. Avoid Using Inline Styling it is most worst style of writing CSS.
  4. We can assign style attribute to the HTML element and directly specify the properties and values to Element without actually defining the rule.

Complete Example of Inline Styling :

<html>

    <head></head>

    <body>
            <h1>This is H1 Heading Without Style</h1>

            <h1style="color:blue;margin-left:60px">
            This is a H1 Heading.
        </h1>

            <h2style="color:red;margin-left:60px">
            This is a H2 Heading.
        </h2>

            <h3style="color:black;margin-left:60px">
            This is a H3 Heading.
        </h3>

            <h4style="color:cyan;margin-left:60px">
            This is a H4 Heading.
        </h4>

            <h5style="color:green;margin-left:60px">
            This is a H5 Heading.
        </h5>

    </body>

</html>

Output :

Inline Style Sheet Example