Reputation: 11
I am trying to setup the font-family "Ravie" in a HTML document using the following code:
<h2><font font-family="ravie">Articles</font></h2>
but this is not working. Why not?
Upvotes: 1
Views: 3765
Reputation: 837
<h2 style="font-family:tahoma">Articles</h2>
The <font>
tag is deprecated in the latest versions of HTML (HTML 4.01 and XHTML 1.0).
Upvotes: 0
Reputation: 1317
<h2><td align="center" class="addfont">Articles</h2>
.addfont
{
font-family: 'ravie';
}
can you try like this? It's very simple . Another advantage is the script can be used inside the page or outside the page,but if you use the outside of page. You must use below the line
<link href="/styles/Filename.css" rel="stylesheet" type="text/css">
Upvotes: 0
Reputation: 171411
To use the deprecated FONT
tag:
<h2><font face="ravie">Articles</font></h2>
Better yet is to use inline styles:
<h2 style="font-family:ravie" >Articles</h2>
And even better is to use header style information:
<head>
<style>
h2 {font-family: ravie;}
</style>
</head>
<body>
<h2>Articles</h2>
</body>
Best of all is to move the style declaration to an external style sheet, and this is standard practice unless you have a strong reason for not doing so.
Upvotes: 8
Reputation: 25445
you do it like this:
<h2 style="font-family:arial">...</h2>
or you do it in your stylesheet. like this:
<h2 class="somthing">...</h2>
.something { font-family:arial }
don't use <font>
tags as they have been deprecated.
read: http://en.wikipedia.org/wiki/Font_family_%28HTML%29
Upvotes: 3
Reputation: 9173
The <font>
tag is deprecated and no longer used. The better practice now is to use CSS combined with selectors, divs, and spans to style fonts.
Upvotes: 0