HTML Style - Javatpoint
HTML Style - Javatpoint
ADVERTISEMENT
HTML Style
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.
style= "property:value"
Let's see a simple example of styling html tags by color property of css.
Test it Now
Output:
https://www.javatpoint.com/html-style 2/7
5/2/24, 4:14 PM HTML Style - javatpoint
Test it Now
Output:
Test it Now
Output:
Test it Now
https://www.javatpoint.com/html-style 3/7
5/2/24, 4:14 PM HTML Style - javatpoint
Output:
Test it Now
If you want to put heading at center or left, use "text-align:center" or "text-align:left" respectively.
Output:
HTML5 doesn't support <center> tag which is supported in older version of HTML.
https://www.javatpoint.com/html-style 4/7