| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Modern elements

Page history last edited by Joseph Lowery 15 years, 3 months ago

Avoid deprecated and nonstandard elements

Deprecated—a fancy word for "no longer in service"—elements and attributes should be replaced as soon as you can. Although they are likely to be supported by a range of browsers for a while, there's no telling when a new browser version will drop support which will, in turn, break your page. Likewise, some elements which are not deprecated, but are considered nonstandard like <b> and <i>, should be updated. In some cases, older elements or attributes should give way to their more standard equivalents, but sometimes you can get the same effect with a CSS property. Some elements listed below

 

Here's what can be replaced with what:

 

Nonstandard element or attribute

Replacement element or CSS property

<dir> <ul>
<menu> <ul>
<applet> <object>
<embed> <object>
<b> <strong> or font-weight: bold
<i> <em> or font-style: italic

<u>

text-decoration: underline
<s> text-decoration: line-through
<strike> text-decoration: line-through
<font> and <basefont> font-family:, font-size:, color:
align text-align:
border border: [type] [size] [color]

 

Note: There are exceptions to every rule. You might need to use <embed> to get rich media working in an older browser.  And there are certain circumstances where it makes sense to use <b> instead of <strong> and <i> instead of <em>:

 

* You're marking up an unordered list, which you will later style in CSS to look like a navigation bar in CSS-capable browsers. You want to highlight the nav bar's Home "button" to indicate that the user is on the home page, and you want this "you are here" information to come across even in non-CSS environments. Wrapping the Home link in <b> tags will do the trick while avoiding false semantics.

 

* In Paul Ford's example: "When I'm publishing content from 1901 and it's in italics, it's in italics, not emphasized. Typography has a semantics that is subtle, changing, and deeply informed by history."

Comments (0)

You don't have permission to comment on this page.