HTML Styles

Style is of three types in HTML:

  1. Inline
  2. Internal
  3. External


Style is used to provide property to text like background-color, font-size, font -family, text-color, etc.

Styling HTML is also know as CSS

In this we will use inline css and rest will lean in CSS Tutorial


<tagname style="property:value">Content . . . </tagname>


HTML Background-color



<html>
      <head>
            <title>
                   Background Color
            </title>
      </head>
      <body style="background-color:lightgreen;">
            <p>This is Paragraph. This is Paragraph.</p>
            <p>This is Paragraph. This is Paragraph.</p>
            <p>This is Paragraph. This is Paragraph.</p>
      </body>
</html>


Output


This is Paragraph. This is Paragraph.
This is Paragraph. This is Paragraph.
This is Paragraph. This is Paragraph.

HTML Text Color



It used to give color to text.


<html>
      <head>
            <title>
                   Background Color
            </title>
      </head>
      <body>
            <p style="color:red;">This is Paragraph. This is Paragraph.</p>
            <p style="color:geen;">This is Paragraph. This is Paragraph.</p>
            <p style="color:blue;">This is Paragraph. This is Paragraph.</p>
      </body>
</html>


Output


This is Paragraph. This is Paragraph.


This is Paragraph. This is Paragraph.


This is Paragraph. This is Paragraph.

Back To Top