Topic: Instead of FONT, what? (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=10772" title="Pages that link to Topic: Instead of FONT, what? (Page 1 of 1)" rel="nofollow" >Topic: Instead of FONT, what? <span class="small">(Page 1 of 1)</span>\

 
DangBat
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2000

IP logged posted posted 07-17-2002 00:34 Edit Quote

Ok, simple question. I know the FONT tag is deprecated, Homesite enjoys telling me that enough times, w3 tells me that, everyone says it.

So, what should I use INSTEAD of font? I need to make a certain part of the sentence green, bigger, and bold, for instance. The only tag that I can think of is the SPAN tag, which seems as much a nothing tag as possible, and set it's style property to whatever I want.

I just have no idea whether or not that's the right way to do it, and unfortunately, I can't find confirmation anywhere.

So, what's the 'correct' method of phasing out the FONT tag?

Thanks.

-D
(Hey, I'm a maniac now!)

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 07-17-2002 00:53 Edit Quote

yep, in that scenario, <span> is your best bet. Preferably with styles defined in a style sheet and called via the "class" attribute rather than defining the styles inline (which more or less renders it no more useful than the <font> tag).




Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 07-17-2002 01:29 Edit Quote

Part of the reason of removing the font tag and using CSS for style information is so that you can make your markup more descriptive of what it holds.

You're saying you want certain text green, big, and bold. Sounds to me like you're describing the type of text that one might place in a <strong> tag. You could certainly use a span tag, but there would be two disadvantages to that:

1. You would have to place the style information in a style="" attribute, which puts your style information in with your markup, which is what removing the <font> tag is supposed to help prevent. This should only be done when absolutely necessary.

2. <span> offers no description of what's inside it -- as you said, it's a "nothing" tag, that does absolutely nothing to its content unless you use styles to tell it to.

So you end up with two reasonable solutions:

1. <span class="importantstuff">blah blah blah</span>
2. <strong>blah blah blah</strong>

Or you could use some other HTML tag that may suit your purpose. I recommend strong in this particular case, because that's descriptive of the text - you want strong, more noticeable text. While the <span> tag with a class is also descriptive of the text, because of the class' name, it's favorable to use the tag that's already been defined to do what you want done. So, once you've applied the <strong> tags around this text, you can go into your CSS and add

strong {
font-size:larger; /* this might be supposed to be "bigger" */
color:green;
font-weight:bold;
}

Then you can reuse the <strong> tag anywhere you want that strong type of text.



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu