How to NOT use the font tag

C

Chris Leonard

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
 
K

kayodeok

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
 
A

Andreas Prilop

Chris Leonard said:
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>
 
J

Jukka K. Korpela

Chris Leonard said:
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.
 
D

David Dorward

kayodeok said:
<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.
 
K

kayodeok

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.
 
R

rf

David Dorward said:

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.
 
C

Chris Leonard

* Is it really a paragraph?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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top