Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to NOT use the font tag

Reply
Thread Tools

How to NOT use the font tag

 
 
Chris Leonard
Guest
Posts: n/a
 
      10-31-2003
Can someone help me with this problem please.

I'm converting my site and trying to make it all w3c compliant, so I'm
using CSS instead of the older style HTML tags. All is going well, but then
I hit a problem.

Here is the old code:

<font size="10">One</font>&nbsp;
<font size="20">Two</font>&nbsp;
<font size="30">Three</font>&nbsp;

Output would be One Two Three (but they go up in size!)

How do you do this in CSS please ?

I will eventually want to use different font styles and I'll come across the
same issue no doubt. I'd thought of using three DIVs and positioning them
all one after the other, but isn't that over kill ? maybe it's not.

Your comments please.

Thanks

Chris


 
Reply With Quote
 
 
 
 
kayodeok
Guest
Posts: n/a
 
      10-31-2003
"Chris Leonard" <> wrote in
news:bnui4c$6e1$:

> Can someone help me with this problem please.
>
> I'm converting my site and trying to make it all w3c compliant,
> so I'm using CSS instead of the older style HTML tags. All is
> going well, but then I hit a problem.
>
> Here is the old code:
>
> <font size="10">One</font>&nbsp;
> <font size="20">Two</font>&nbsp;
> <font size="30">Three</font>&nbsp;
>
> Output would be One Two Three (but they go up in size!)
>
> How do you do this in CSS please ?


I am not familiar with font sizes and I am making an assumption
on your page structure:

<style type="text/css">
#small {font-size:100%}
#medium {font-size:110%}
#big {font-size:120%}

</style>

<p><span id="small"> One </span><span id="medium"> Two </span><span id="big"> Three </span></p>

Change the font sizes as you see fit

--
Kayode Okeyode
http://www.kayodeok.co.uk/weblog/
 
Reply With Quote
 
 
 
 
Andreas Prilop
Guest
Posts: n/a
 
      10-31-2003
"Chris Leonard" <> wrote:

> Here is the old code:
> <font size="10">One</font>&nbsp;
> <font size="20">Two</font>&nbsp;
> <font size="30">Three</font>&nbsp;
> Output would be One Two Three (but they go up in size!)
> How do you do this in CSS please ?


Zero
<big>One
<big>Two
<big>Three
<big>Four
<big>Five
</big></big></big></big></big>

--
Meanwhile at the Google Ranch ...
"I can't read this bloody site; it's all Falsh and JavaScrap."
"Forget it and move on! Still 2*718*281*828 pages to crawl."
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      10-31-2003
"Chris Leonard" <> wrote:

> I'm converting my site and trying to make it all w3c compliant,


Why? It's generally useful to follow W3C recommendations, with due critical
considerations, but seldom productive to just convert a site in order to
comply with them. If you are _redesigning_ a site, then it's a different
issue, but then it's mostly not conversion but... redesign.

But why don't you post the URL?

> Here is the old code:
>
> <font size="10">One</font>&nbsp;
> <font size="20">Two</font>&nbsp;
> <font size="30">Three</font>&nbsp;


What could possibly be the reason for _that_? Is this a real example? If
not, why not?

The size attribute of <font> has a defined meaning only when its value is
an unsigned integer from 1 to 7 or a signed integer which yields such an
integer when added to the current base font size value. So those tags have
no defined meaning.

If you just want the font size to increase, for some odd reason, then you
simply set the font-size property in CSS. How you do that really depends on
how big they should be, and this depends on the purpose and context.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Chris Leonard
Guest
Posts: n/a
 
      10-31-2003
> </style>
>
> <p><span id="small"> One </span><span id="medium"> Two </span><span

id="big"> Three </span></p>
>

Brill, thanks


 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      11-01-2003
kayodeok wrote:

> <p><span id="small"> One </span><span id="medium"> Two </span><span
> id="big"> Three </span></p>


Of course that's not a very good example, but given the original question
its difficult to come up with one.

* Is it really a paragraph?
* Could the three words be better described in markup?
* Would there be a wish to reuse the styles somewhere else on the page?
(Because id isn't a good idea then)
* The value of id attributes should describe the meaning, not the
appearance, of the element they apply to.

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
kayodeok
Guest
Posts: n/a
 
      11-01-2003
David Dorward <> wrote in
news:bnvuof$a3s$1$:

> kayodeok wrote:
>
>> <p><span id="small"> One </span><span id="medium"> Two
>> </span><span id="big"> Three </span></p>

>
> Of course that's not a very good example, but given the original
> question its difficult to come up with one.
>
> * Is it really a paragraph?
> * Could the three words be better described in markup?
> * Would there be a wish to reuse the styles somewhere else on
> the page? (Because id isn't a good idea then)
> * The value of id attributes should describe the meaning, not
> the appearance, of the element they apply to.
>


David, I struggled with the value of the id attributes but I had no
idea what he was trying to do...

The rest of you comments are valid by the way.

--
Kayode Okeyode
http://www.kayodeok.co.uk/weblog/
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      11-01-2003
kayodeok wrote:

>> Of course that's not a very good example, but given the original
>> question its difficult to come up with one.


> David, I struggled with the value of the id attributes but I had no
> idea what he was trying to do...


Exactly

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      11-01-2003

"David Dorward" <> wrote in message
news:bo00t6$p03$2$...
> kayodeok wrote:
>
> >> Of course that's not a very good example, but given the original
> >> question its difficult to come up with one.

>
> > David, I struggled with the value of the id attributes but I had no
> > idea what he was trying to do...

>
> Exactly


It's part of a mass bungie jumping competition page?

<site location="bridge">
<big>one<big>two<big>three<reallybig>JUMP
</reallybig></big></big></big>
</site>

Cheers
Richard.


 
Reply With Quote
 
Chris Leonard
Guest
Posts: n/a
 
      11-01-2003
> > * Is it really a paragraph?
> > * Could the three words be better described in markup?
> > * Would there be a wish to reuse the styles somewhere else on
> > the page? (Because id isn't a good idea then)
> > * The value of id attributes should describe the meaning, not
> > the appearance, of the element they apply to.
> >

Guys.

The example I gave was one I felt best described my problem in an easy to
understand way. The solution was excellent, what I had not understood was
that there was such a thing as the <span> tag.

You were quite right David, id is not always the best one to use and I found
this out by validating the site! It wouldn't validate with "id" but it would
with "class" - problem, I used ASP to pick info out of a DB and display it
so I'd used "id=xyz" about 5 times! swapped it to class and bingo.

Thanks once again for your help.

Chris


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
How to get the text in html tag.like<div...><font...>Text</font></ =?Utf-8?B?Tmlja3k=?= ASP .Net 2 02-20-2005 03:03 PM
ClearType: Does Java AWT use its own font or use the OS's font in displaying text field? gino Java 3 07-11-2004 01:57 AM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57