...

View Full Version : font-tag vs. CSS



Crasy_J
07-05-2002, 12:39 PM
Hi, I'm just wondering if there is a reason to use the font-tag to get text into shape.

Why don't use only CSS?

Does anyone got an idea why Dreamweaver still supports the font-tag ?

In my opinion is using the font-tag a sign for bad HTML-design, isn't it?


greetings


Joanna

Zvona
07-05-2002, 12:55 PM
FONT and BASEFONT are deprecated.

http://www.w3.org/TR/html401/present/graphics.html#edef-FONT

applesauce
07-05-2002, 02:28 PM
i just started using css a few months ago. i think it is the better way, especially since font is deprecated, like you said. i think it is just going to take a little while for everyone to make the conversion to css

ACJavascript
07-06-2002, 03:48 PM
In my experiances CSS font attributes have not always been compatible with other browsers. So i think that html font tags are the best way to go. ;)

mouse
07-06-2002, 04:28 PM
CSS is far more powerful; you can predefine classes - in a *.css for more power - and re-use them throughout a page or even site. Obviously there's little advantage in terms of byte reduction unless you have recurring code but most people have enough of that for it to be beneficial and it's a godsend when changing the look of multiple pages.

redhead
07-06-2002, 04:51 PM
I'd say CSS, the only font i ever use is verdana anyways, but when i want to change the style of a whole site, its not my idea of fun to change every font tag ;)

but... one of the sites i made was aimed at IE5+, with a text only version for practically everyone else. On that one i used <font> tags because I'm not too sure how supported the CSS thing is...

thats my views anyways :cool:

ronaldb66
07-08-2002, 01:00 PM
Tags for presentation (like the FONT tag) are typical for older versions of HTML; the last version of HTML, 4.01, and the new XHTML 1.0 strongly aim for seperation of structure (HTML) and presentation (CSS) and therefore deprecate such tags.
The only reason for using tags like FONT instead of CSS may be browser incompatibility, but for the rest using tags like these is considered bad coding practice.

Cam
07-08-2002, 06:07 PM
I'm just starting to use CSS as well. Font-tags (as has been pointed out) help with really old browsers pre- IE/NN 4 (depending on the characteristic). What I think the major down-side is (and has been already discussed) is the difficult with maintenance. Maintaining a site which uses font tags can be a real pain in the posterior orbus. CSS makes it much easier and you can make global changes (ie. multiple pages) without editing each one (unless you decide to monkey with the class names).

For a simple page, font tags may make for less work, but I think its generally a less flexible and long-term viable option.

Cheers

Cam

ACJavascript
07-08-2002, 08:01 PM
Ronald,

Although i do agree with the fact that css is good for a large site.
I DO NOT AGREE on this:

but for the rest using tags like these is considered bad coding practice.


I feel it is perfectly fine to practice this type of coding, for it allows the student to really enter themselve into designing there pages. I believe it is good coding practice :D

boxer_1
07-08-2002, 08:30 PM
I personally would reccomend using CSS whever possible, with few exceptions. Sometimes I use the font tag if I want to quickly apply a diff color, size, face, etc. to a letter or word within a paragraph with its style (font-size, color, family, weight, etc.)already defined as via CSS.

One problem with extensive use of the font tag is that the tag may become obsolete and may not be supported by future browser version releases. IF or when that happens, it could become quite a task for all those who used the font tag extensively to go back through every page, remove the font tags, and impliment CSS in order to make their page compatable with the new (yet to be seen) browser version that doesn't support the font tag. *Old cliche* 'An ounce of prevention is worth a pound of cure' ;). Here's a couple of links inline with this discussion that may or may not be of interest:

http://campus.leeds.ac.uk/guidelines/accessibility/deprecated.htm

http://www.htmlgoodies.com/html4-ref/part4.html

mouse
07-08-2002, 09:21 PM
Originally posted by boxer_1
I personally would reccomend using CSS whever possible...Me too, for positioning too.

Originally posted by boxer_1
Sometimes I use the font tag if I want to quickly apply a diff color, size, face, etc. to a letter or word within a paragraph with its style (font-size, color, family, weight, etc.)already defined as via CSS.I've taken to using span's for that stuff.

CSS gets rid of the need for a dozen nested tags, that's gotta be good for browsers and coders alike.

Feyd
07-08-2002, 11:07 PM
To add on to mouse's post, the SPAN tag is specifically for the application of pure style (color, size, weight, etc.) and thus using the deprecated font tag to do that, when you have the span at your disposal, is kind of...well, you get the idea :thumbsup:

boxer_1
07-09-2002, 12:16 AM
Originally posted by Feyd
To add on to mouse's post, the SPAN tag is specifically for the application of pure style (color, size, weight, etc.) and thus using the deprecated font tag to do that, when you have the span at your disposal, is kind of...well, you get the idea :thumbsup:

Did you add to Mouse's post or use it as a vehicle to point out the imperfections of my post :D? (j/k) Yes, I agree that the span element is more suitable than the font element for applying styles such as color, font-size, font-weight, etc.

I DO use the span element as well, but also admit that I still use the font element on occasion if I want to quickly apply, for example, a different color to a word in a paragraph where the style for the paragraph is already defined in my style sheet. Not saying it's the right / best way, just being honest and saying it's the way I sometimes do it. A habit that needs to eventually go just as anyone using the font element period. The center element (http://www.w3.org/TR/REC-html40/present/graphics.html#edef-CENTER) is also deprecated and may become obsolete, do you ever use that? :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum