Sunday, July 5, 2009

Font Tags As Style Statement

W3C says: The <font> tag in HTML is deprecated. It is supposed to be removed in a future version of HTML.

Even if a lot of people are using it, you should try to avoid it, and use styles instead.


Yipes. I have always used the <font> tags, so I probably have lots of errors out there, but I don't think I'll correct any of them until they truly cease to work. Meanwhile I guess I will try to use the "styles". I'm still teaching myself and will probably step on my own whoosit! But let's plod on and look at the following that you/I might place in a post:

<p style="font-family:Times New Roman;font-size:130%;color:green">

ALL of it should precede the text to be viewed (green text below). View the Source Code for this post if that isn't clear.)


This is a sentence with some text in it. This is a dizzy sentence with some text in it. This is yet again a sentence with some text in it. This is another sentence with some text in it. This is a sentence with some silly green text in it. This is another silly sentence with some text in it. This is a damn sentence with some text in it. This is a puke-green sentence with some more damn text in it.



That would be too complicated, I suppose, if you needed it for frequent use or intended it for every post. I need to establish it as a CSS description so that it's on tap when I need it. So I'll add

#fs1 {font-family:Times New Roman;font-size:130%;color:green; }

to my template's CSS (cascading style sheets). The "fs1" is just an arbitrary code that I made up; as long as it is repeated in the code below, any word you choose instead will do.

Reference to the #fs1 is placed in the post thus:

<div id="fs1"> text </div>

No comments:

oxford blogger university player