HTML Style

By | January 3, 2020

We can do something style in HTML and give it a new look. In HTML we can replace HTML text color,font,background etc.To style style propertie is given in HTML inside that element is style.

<tagname style="property:value;">

Some Example:-

Text Size:-

<h1 style="font-size: 30px;">This is h1 heading.</h1>
<h2 style="font-size:25px;">This is h2 heading.</h2>
<p style="font-size: 20px;">Lorem ipsum dolor sit amet, consectetur adipisicing.</p>

Output:-

font size

Background color:-


<body style="background-color: yellow;">
	
<h1>This is h1 heading.</h1>
<h2>This is h2 heading.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing.</p>

</body>

Output:-

background-color

Fonts:

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

Output:-

font-family

Text Alignment:-

<h1 style="text-align: center;">This is h1 heading.</h1>
<h2 style="text-align: center;">This is h2 heading.</h2>

Output:-

textalign

Text Color:-

<h1 style="color: red;">This is h1 heading.</h1>
<h2 style="color: green;">This is h2 heading.</h2>
<p style="color: yellow;">Lorem ipsum dolor sit amet, consectetur.</p>
text-color
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *