January Homework Answer

The January quiz question raises questions about style versus content and CSS vs. HTML. Here is my take on the question:

Paragraph 1: Per the W3C specifications, <u> and <s> (or <strike>) are deprecated in favor of style sheets.

The W3C says this about the term "deprecated":


A deprecated element or attribute is one that has been outdated by newer constructs. Deprecated elements are defined in the reference manual in appropriate locations, but are clearly marked as deprecated. Deprecated elements may become obsolete in future versions of HTML.

User agents should continue to support deprecated elements for reasons of backward compatibility.


In general, authors should use style sheets to achieve stylistic and formatting effects rather than HTML presentational attributes. HTML presentational attributes have been deprecated when style sheet alternatives exist (see, for example, [CSS1]).


Paragraph 2: <ins> and <del> have specific purposes: These tags indicate editing of documents. The HTML specification does not require that the browsers render the marked text in any particular way. The specification states,

User agents should render inserted and deleted text in ways that make the change obvious. For instance, inserted text may appear in a special font, deleted text may not be shown at all or be shown as struck-through or with special markings, etc.

So these tags actually have no specific type of appearance associated with them. All the browsers I have seen use underline and overstrike, but they could use other markings like colors instead.

Paragraph 3: The text-decoration property is just that--a definition of the appearance of the text. Just as with <u> and <s>, there is no meaning attached to the decoration; it is just presentational.

Sooo... While all three are legal at this time, if the purpose is to underline or overstrike as a stylistic device, use CSS rather than the deprecated HTML tags. If the purpose is to show editing, use <ins> and <del>. BUT...do not use <ins> and <del> when all you want is to add style to the page. And do not use text-decoration or <u> and <s> when you want to show editing of a document.

And remember, you can use CSS with <ins> and <del>. You could give your HTML document the same appearance that a word processor would give. Look at this sample page. And here is a real-life example that is more elaborately styled. Note also that you can give those tags titles which in most browsers will show up as comments as a popup when the cursor is over the tagged text. (That actually works with <u> and <s> as well.)