Jun 17, 2016

HTML Text Color

We can define font color in the <body> tag. It is change the color of the text on a web page and We can easily define  the text color in HTML

Syntax  :


<h1 style="color:orange;">dog and cats</h1>
<p style="color:red;">it is all for the best</p>


output is


dog and cats

it is all for the best


In CSS use following syntax:


<html>
<head>
<title>text color</title>

<style type="text/css">

 #example1{ color: red; }
#example2 { color: orange; }

</style>

</head>
<body>

<p id="example1">The sun rises in the east</p>
<p id="example2">fruit name is orange</p>

</body>
</html>


result is :


The sun rises in the east

fruit name is orange


HTML Fonts

HTML Fonts defines  change the font face which is use in HTML element :



<h1 style="font-family:italic;">child is sleeping</h1>
<p style="font-family:normal;">men is talking.</p>