Monday, 11 July 2016

Use of Inline CSS in html | How to apply inline css

Inline CSS

Inline CSS is used to apply style to Html elements.Use Inline CSS within the html tag where you want to apply.

1.Create a html page with .html extension.

2.Put some html tags to apply inline CSS for individual item. For example :here we put a heading tag and a paragraph.

<h1>Hello Red</h1> <p>Hello Blue</p>

3.To apply inline CSS we use "Style" attribute within the heading and Paragraph tag different for heading and paragraph tag. like 

<h1 style="color:red;">Hello Red</h1>
<p style="color:blue;font-size:150%">Hello Blue</p>

Here the example of Inline CSS:

           <!DOCTYPE html>
      <html>
      <head>
          <title>Inline CSS </title>
      </head>
      <body>
Inline CSS
       <h1 style="color:red;">Hello Red</h1> 
       <p style="color:blue;font-size:150%;">Hello Blue</p>
      </body>
      </html>
The output is shown below:
Inline CSS
Inline CSS

Please comment for suggestions! Enjoy Learning web Development.
Inline CSS


1 comment:

Leave a Reply!