Enter your email id to get regular update free
Your Email

How to use HTML Styles?

Setting the style of an HTML element is done with the style attribute

The HTML style attribute use the  following syntax
<tagname style="property:value;">
The property is a CSS property. 
The value is a CSS value.
Background Color
The background-color property defines the background color for an HTML element.
To set the background color use the following code:
<body style="background-color:green;">
<p>Paragraph .The web page is with green background</p>

Color of Text
The color property of HTML defines the text color for an element.
<h1 style="color:blue;">Heading</h1>
<p style="color:green;">The paragraph text is in green color </p>

The font-family property defines the font to be used for an HTML element.
<h1 style="font-family:verdana;">Heading</h1>
<p style="font-family:courier;">paragraph aaaaaa bbbbb ccc</p>

Text Size
The font-size property defines the text size for an HTML element.
<h1 style="font-size:400%;">Heading</h1>
<p  style="font-size:200%;">This is a paragraph</p>

Text Alignment
The text-align property defines the horizontal text alignment for an HTML element.
<h1 style="text-align:center;">Heading in center</h1>
<p style="text-align:center;">This paragraph is in center.</p>
These syntax can be followed to apply simple styling on text and web page. 
HTML Styling
Tech writer at newsandstory
Total 617 views