Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to apply inline CSS ?

  • Difficulty Level : Easy
  • Last Updated : 17 Mar, 2021

Inline CSS contains the CSS property in the body section attached with the element is known as inline CSS. This kind of style is specified within an HTML tag using the style attribute. It is used to apply a unique style to a single HTML element.

Syntax:

<tag style = " "></tag>

Example 1:

HTML




<!DOCTYPE html>
<html>
  <body>
    <p style="color: #009900;
              font-size: 50px;
              font-style: italic;
              text-align: center;">
      GeeksForGeeks
    </p>
  </body>
</html>

Output:



Example 2:

HTML




<!DOCTYPE html>
<html>
  <body>
    <h2 style="color: green; background: yellow">
      Geeks For Geeks
    </h2>
    <p style="color: black">
      Happy Preparation!!.
    </p>
  </body>
</html>

Output:




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!