View Full Version : what is the XHTML equivalent of <font>?
Jake Bunce
Fri 9th Apr '04, 12:40am
n/t
daemon
Fri 9th Apr '04, 2:01am
There is no <font> tag, but rather a tag called <span>.
To style it, you use <span style=""> (it take the same elements as standard CSS).
So, just stick CSS styling elements in and you'll get the equivalent.
Here are the two CSS models (W3C standards):
http://www.w3.org/TR/CSS1
http://www.w3.org/TR/CSS2/
diades
Fri 9th Apr '04, 8:32am
As daemon stated, the <font> tag has been deprecated. The replacement is using css font or the constituent attributes of it such as font-family These, in xhtml, can be used on pretty-well any element's style.
CeleronXT
Fri 9th Apr '04, 11:58am
To expand on that and make it simple without having to read any lengthy W3 pages, if you want to do inline (even though inline isn't really that great) font styling, you can simply do this:
<span style="font-family: verdana,sans-serif; size: 12px; color: #000000;">Stuff</span>
You can, of course, leave out any of the attributes you don't need, like color/size.
<span style="font-family: verdana,sans-serif; size: 12px;">Stuff</span>
<span style="font-family: verdana,sans-serif; color: #000000">Stuff</span>
<span style="font-family: verdana,sans-serif;">Stuff</span>
Shining Arcanine
Sat 10th Apr '04, 4:49pm
Don't use font tags, use css classes.
Jake Bunce
Sun 11th Apr '04, 5:30pm
CSS classes don't stand alone. You need some kind of tag to use the CSS class. That was what my question was about.
In my case I am creating custom titles for my vB3 groups and I want to know what tag I should use in the custom title field besides font. There is no reason for me to use classes for my titles since each title is the only instance of that particular style.
the Sandman
Sun 11th Apr '04, 5:41pm
Here's what we're using for our Admin Titles - it works fine, but is it considered "correct"?<span style="color:darkblue" title="Administrator"><i><b>Username</b></i></span>
Stadler
Sun 11th Apr '04, 5:42pm
Well, you 'can' use the font-tag in XHTML, except in XHTML-strict. It's not forbidden there, but using <span ... + CSS-fomatting is the better choice anyway.
diades
Sun 11th Apr '04, 7:30pm
CSS classes don't stand alone. You need some kind of tag to use the CSS class. That was what my question was about.Hi jake
Not, strictly. You can have:
<style type="text/css">
/*<![CDATA[*/
/* This class will be available to whichever tag that you
wish to declare the class attribute for*/
.clsRed{color:#ff0000; background-color:transparent}
/* This class will be available to tags fo type span only that you
wish to declare the class attribute for*/
span.clsBlue{color:#0000ff; background-color:transparent}
/*]]>*/
</style>
So, to some extent, you can have an "open" class and use it wherever you wish.
Sandman:
<span style="color:darkblue" title="Administrator"><i><b>Username</b></i></span>would be better written:
<span style="color:darkblue;font-style:italic; font-weight:bold;" title="Administrator">Username</span>
even better, of course, as a class:
<style type="text/css">
/*<![CDATA[*/
.admin{color:darkblue;font-style:italic; font-weight:bold;}
/*]]>*/
</style>
....
<span class="admin" title="Administrator">Username</span>
hth
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.