Horje
What is HTML Styles | HTML Styles Code
What is 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



Read Full::
HTML Styles Code
Category:
HTML Code
Sub Category:
HTML Styles Code
Uploaded:
10 months ago
Uploaded by:
Admin
Views:
1

Related Articles
What is HTML Styles HTML Styles Code
How to create HTML Style Attribute HTML element HTML Styles Code
How to change body Background Color HTML Style HTML Styles Code
How to change Background Color of <h1> and <p> Elements HTML Styles Code
How to change Text Color HTML Styles Code
How to change Fonts Family of Text with HTML <h1> <p> HTML Styles Code
How to change Text Size with HTML <h1> and <p> HTML Styles Code
How to create Text Alignment HTML Styles Code
How to create HTML CSS Border HTML Styles Code
How to create HTML CSS Padding HTML Styles Code
How to create HTML CSS Margin HTML Styles Code

Single Articles
Sample of HTML Styles
Full Example of HTML Styles

Share on: