Horje
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
Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_styles_intro





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

Single Articles
Sample of HTML StylesHTML Styles
Full Example of HTML StylesHTML Styles

Read Full:
HTML Styles
Category:
Web Tutorial
Sub Category:
HTML Styles
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
31



Share on: