October 7,2021
Why you should avoid using deprecated HTML and CSS – Part One
Like everything else, syntax used in HTML and CSS has changed over the years. Code which would have been valid a couple of years ago is now a definite no-no. Why the change in syntax? The simplest answer is that more functional or flexible alternatives have been found and adopted.
Times change, you need to move on.
If you use deprecated HTML and CSS, the best case scenario is that your website will not validate, which hey, isn’t the worst thing in the world. However I do think that web standards are important, all developers that take pride in their work do.
That isn’t the worst case scenario. Browsers should support depreciated tags, but support cannot be guaranteed. This means that if you use deprecated syntax, your website could end up breaking on the next browser update.
Deprecated HTML Tags
Here are some deprecated HTML tags, which you should avoid at all costs.
Deprecated HTML tags | Description | Replacement |
<applet> | Inserts applet | <object> |
<basefont> | sets font styles | CSS |
<center> | centers elements | <div style=”text-align:center”> / CSS |
<dir> | directory list | <ul> |
<font> | applies font styles | font stylesheets / CSS |
<isindex> | adds search field | <form> with relevant <input> |
<menu> | menu list | <ul> |
<s> | strike through | CSS |
<strike> | strike through | CSS |
<u> | underline | CSS |
Along with the above tags that are deprecated there are also attributes you should really try to stay away from. In part two we will consider which of these you should avoid.