6/24/20

HTML STYLES



HTML STYLE

In Html, the style attribute is used to add style to an element. Eg Color, background color, font size, weight, etc.

Syntax of the Html style

<tagname style= "property: value;">

The Property and value is the CSS property and value respectively.

Background Color

You can change your Html webpage background color. 
The CSS background-color property was used to change the background color of your webpages.

Example to change whole page background-color

<body style = "background-color:Yellow">

<h1> Example of HTML Styles </h1>

<p> This is a paragraph tag. </p>

</body>

Output:-


Example to change background color of two different elements:-

<h1 style=”background-color:red”> Example of HTML Styles </h1>

<p style=”background-color:yellow”> This is a paragraph tag. </p>

Output:-


TEXT COLOR

You can also change your text color by applying CSS color property. Let’s see through an example.

Example to change text color:-

<h1 style = "color: purple"> Example of HTML Styles </h1>

<p style = "color: Blue"> This is a paragraph tag. </p>

Output:-


TEXT SIZE

You can change your text size by applying font-size CSS property. Let’s see through an example.

Example to change font size

<h1 style = "font-size:48px"> Example of HTML Styles </h1>

<p style = "font-size:40px"> This is a paragraph tag. </p>

Output:-


FONTS

You can also change your fonts by applying font-family CSS property. Let’s see through an example.

Example to change fonts

<h1 style = "font-family:Algerian"> Example of HTML Styles </h1>

<p style = "font-family: Forte"> This is a paragraph tag. </p>

Output:-


So friends, today we learned about Html styles I hope you understand. If you have any quarries about this article comment below.

Thank you so much for visiting here.

Have a nice day you all.


0 comments:

Post a Comment

Like us on facebook

blogger templatesblogger widgets

Follow on Twitter

Linkedin

Categories

Contact Form

Name

Email *

Message *

Mad About Computer. Powered by Blogger.