HTML Styles

HTML STYLES

HTML  elements have default styles such as background color is white, text colors black etc.HTML provides style attributes to change this default values. HTML style attribute has the following syntax. 
style="property:value"
The property is a css property and value is a css value. 
<body style="background-color:lightgrey">

HTML Text color
Color property is used to give colour to Html Element.It can be used to give colour to certain texts.
HTML Text Fonts
Font-family property tells the font to be used for an Html Element. Font of some text can be changed.
HTML Text Size
The font-size property defines the text size to be used for an HTML element. Font size is given in percentage basis.
HTML Text Alignment
The text-align property defines the horizontal text alignment for an HTML element.It decides were to position the text(center,right or left).


<html>
<head>
</head>
<body >
<h1 style="font-family:verdana">This is a heading</h1>
<p style="color:red">This is color property</p>
<p style="font-family:courier">This is a paragraph.</p>
<h1 style="font-size:200%">This is size property<p>
<h1 style="text-align:center">This Heading is at center</h1>
<p>This is a paragraph.</p>
</body>
</html>

Output

This is a heading

This is color property
This is a paragraph.

This is size property

This Heading is at center

This is a paragraph.

0 Comment "HTML Styles"