Knowledge Base Articles » KB100225: CSS Style Sheets Alternatives to Deprecated HTML Tags.
It may be hard to believe, but certain commonly used HTML tags have been deprecated!
The World Wide Web Consortium (W3C), has now revised the HTML 4.0 standard to
deprecate several display tags:
basefont, center, font, s, strike, and
u.
So what is going on?
The use of Cascading Style Sheets (CSS), usually referred to as style sheets,
is now exerting a major influence in the coding of Web pages.
Style sheets offer an improvement over the traditional HTML-only Web document by easily separating the
formatting/display-characteristics of a page from its content.
The site content is still described using standard HTML tags, but style sheets
should now be used to create an appearance and presentation for the site.
Therefore, the
Guru strongly recommends that you start now to regularly use CSS.
Fortunately, style sheets are very easy to code.
In the following table, we show how to replace these deprecated HTML tags with style sheets.
We also display text that shows how to relate the HTML font
size attribute
to the CSS
font-size property.
| HTML Tag |
Style |
| <center> |
style="text-align:center" |
| <font color="blue"> |
style="color:blue" |
| <font face="courier"> |
style="font-family:courier" |
| <font size="1"> |
style="font-size:10px" |
| <font size="2"> |
style="font-size:12px" |
| <font size="3"> |
style="font-size:16px" |
| <font size="4"> |
style="font-size:19px"
Netscape
style="font-size:18px"
Internet Explorer
|
| <font size="5"> |
style="font-size:24px" |
| <font size="6"> |
style="font-size:32px" |
| <font size="7"> |
style="font-size:48px" |
<s>strikethrough</s> |
style="text-decoration:line-through" |
<strike>strikethrough</strike> |
style="text-decoration:line-through" |
| <u>underline</u> |
style="text-decoration:underline" |