0

What's the best practice when using font tags in html? Should I keep that in the css or use font tags in html?

flag

1 Answer

1

Font tags are frowned upon by many people mainly because it does not describe what your content is -- it describes what it looks like. This limits what style changes can be applied globally.

If you have a website with multiple themes or plan on updating your design in the future, it is much easier to change a few lines in a css file than it is to manually go through all the content on your website and alter the font tags and other markup.

I have seen this dozens of times and have gone through the pains of managing websites that used tons of tables and font tags for styling.

This is much harder to maintain:

<p>
<font face="Arial"><big>Article Headline</big></font><br />
<small>Posted by: <font face="Times" color="gray">Author</font></small><br />
<blockquote>Excerpt here.</blockquote>
</p>

Compared to:

<div class="news">
<div class="title">Article Headline</div>
<div class="detail">Posted by: <span class="author">Author</span></div>
<div class="excerpt">Excerpt here.</div>
</div>

Another thing I should mention is most WYSIWYG rich text editors have poor support for css compliant output and instead they will use many <p> and <font> tags. This is a gray area... I would use font tags at your own discretion.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.