Horje
HTML Styles

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

HTML Style is used to change or add the style on existing HTML elements. There is a default style for every HTML element e.g. background color is white, text color is black etc.

The style attribute can by used with any HTML tag. To apply style on HTML tag, you should have the basic knowledge of css properties e.g. color, background-color, text-align, font-family, font-size etc.

  • Use the style attribute for styling HTML elements
  • Use background-color for background color
  • Use color for text colors
  • Use font-family for text fonts
  • Use font-size for text sizes
  • Use text-align for text alignment

Sample of HTML Styles

We have given following examples to understand about HTML Style:
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</p>
<p style="font-size:50px;">I am big</p>

Full Example of HTML Styles

HTML Styles are used to change the behaviors of HTML Elements. Such as: Text, Color, Size etc...
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</p>
<p style="font-size:50px;">I am big</p>

</body>
</html>

Output should be:

Full Example of HTML Styles





Category:
Web Tutorial
Sub Category:
HTML Styles
Uploaded by:
Admin


Read Article
https://horje.com/learn/1434/reference