5 replies [Last post]
johnohod
Offline
newbie
Last seen: 17 years 16 weeks ago
Timezone: GMT+1
Joined: 2003-10-03
Posts: 3
Points: 0

I have a lot of HTML-code that look like this: <font size=3>wer fgd</font>

Is it possible to use CSS to change how <font size=3> dispalys?

samcollett
Offline
newbie
Last seen: 17 years 17 weeks ago
Joined: 2003-09-26
Posts: 5
Points: 0

Changing &lt;Font size&gt; apperance

Replace <font size="3">text</font> with <span class="text">text</span> and define the following in a css file:

.text{
  font-size: 115%;
}

<font> tags really become obsolete once you use CSS, so should not really be used (plus removing them tidies up your code, reduces the download time, and allows you to update the look of an entire site by editing only one file)

johnohod
Offline
newbie
Last seen: 17 years 16 weeks ago
Timezone: GMT+1
Joined: 2003-10-03
Posts: 3
Points: 0

Changing &lt;Font size&gt; apperance

Obiously the best thing would be to replace the code. However, this is not an option. So my question is wheter or not it is possible to control how the <font size> tags are displayed?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 6 days 10 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Changing &lt;Font size&gt; apperance

Hi johnohod,
Use what Sam mentioned only font instead of .textfont{font-size:115%;}
Hope that helps

johnohod
Offline
newbie
Last seen: 17 years 16 weeks ago
Timezone: GMT+1
Joined: 2003-10-03
Posts: 3
Points: 0

Changing &lt;Font size&gt; apperance

That would work if it was only one font size. But I need to specify settings for <font size=1>, one <font size=2> etc.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 6 days 10 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Changing &lt;Font size&gt; apperance

Hi johnohod,
If your target browser was just Netscape you could use attribute selectors.font[size="1"]{font-size:115%;}Otherwise you will have to use DHTML if you cant modify the font tags.

Hope that helps.