HTML Style

Style means, decorate. That is, to styles an HTML document. By the way CSS is use for Style. But, with the help of just HTML, you can styles a HTML document to your extent according to some extent. HTML Style tag is use to Styling the content in a web document.

Example

<!DOCTYPE html>
<html>
<body>

<p style="color:green;">I am red</p>
<p style="color:blue;font-size:50px;">I am big</p>

</body>
</html>

Using HTML Style tag, we can change the font size or font color of any text. Style tag does not represent the actual content for the user, instead, it is use to style the content.

HTML Background Color

The background-color property is use for background color. We can make a background of any color.

Example

<!DOCTYPE html>
<html>
<body style="background-color:red;">

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

HTML Text Color

The color property is use to set text color in the HTML element.

Example

<!DOCTYPE html>
<html>
<body>

<h1 style="color:green;">This is a heading. This is a heading. This is a heading. This is a heading.</h1>
<p style="color:red;">This is a paragraph.</p>

</body>
</html>

HTML Fonts

font-family property is use for the font you want in the HTML element.

Example

<!DOCTYPE html>
<html>
<body>

<p style="font-family:courier;">This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p>
<h1 style="font-family:verdana;">This is a heading. This is a heading. This is a heading. This is a heading</h1>

</body>
</html>

HTML Text Alignment

To place the text of an HTML element in right, center or left, use the text-align property:

Example

<!DOCTYPE html>
<html>
<body>

<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:left;">Left paragraph.</p>
<p style="text-align:right;">Right paragraph.</p>

</body>
</html>

HTML Text Size

To change text size, use the font-size property

Example

<!DOCTYPE html>
<html>
<body>

<h1 style="font-size:200%;">This is a heading</h1>
<p style="font-size:50px;">This is a paragraph.</p>
<p style="font-size:100px;">This is a paragraph.</p>
<p style="font-size:20px;">This is a paragraph.</p>

</body>
</html>