Styling in HTML

Everything about style is described in detail in this chapter. There are many advantages of style tag in HTML because it make the things in a page very attractive and caused to increase the interest of the user. In CSS3 course we will learn it with detail.

Syntax of style attribute

<tagname style="styleProperty: value;"> content </tagname>

Properties used in style attribute.

Basically there are many CSS properties can be used in html style attribute. Some of them with examples are given below.
1) color
2) background-color
3) font-size
4) text-align
5) font-family

Color property

In this example color property is used. And value is green.

<h3 style="color: green;"> This is green text. </h3>

Output of above code

This is green text.


Background Color property

In this example background-color property is used. And value is yellow.

<h3 style="background-color: yellow;"> Yellow background color </h3>

Output of above code

Yellow background color


Font Size property

In this example font-size property is used. And value is 30px.

<p style="font-size: 30px;"> Yellow background color </p>

Output of above code

Font-size 30px


Text Align property

In this example text-align property is used. And value is left.

<p style="text-align: left;"> I'm in left side </p>

Output of above code

I'm in left side


Font Family property

In this example font-family property is used. And value is Arial.

<p style="font-family: Arial;"> Arial font family </p>

Output of above code

Arial font family

Explore more about styling in CSS3 course.








The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.


ads