View Full Version : what to use in strict? <u> or <ins>?

Apr 1st, 2007, 06:17 PM
what is able to be validated in strict? <u> or <ins>?

Apr 1st, 2007, 06:30 PM
Why donít you put it into the validator (http://validator.w3.org) and see whatís allowed?
I know that <u> still is.

Apr 1st, 2007, 08:23 PM
Why donít you put it into the validator (http://validator.w3.org) and see whatís allowed?
I know that <u> still is.Not correct. The underline element is not valid under HTML 4.01 Strict. You can validate the following code using VIPStephanís link to verify that that element is invalid:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title/CF 111262/
<p/This is a paragraph with <u/underlined text/./

If you take a look at the HTML 4.01 Specificationís Element Table (http://www.w3.org/TR/html401/index/elements.html), youíll also see that the insertion element is valid under the Strict DTD. Specificially, look at the sixth column in the table to see which elements are allowed under which DTD; those missing a letter are allowed under Strict.

Apr 1st, 2007, 08:36 PM
Are you trying to underline something or to indicate that something has been inserted?

To underline you set the text-decoration in the stylesheet.

For inserted content you surround it in <ins> tags and then use the stylesheet to get rid of the underline and set the appearance how you want to mark the inserted text.

Apr 1st, 2007, 11:47 PM
Sorry, I was mistaken. It was <b> thatís still allowed. However, itís not very semanic.

Apr 2nd, 2007, 12:15 AM
Use Css!

Bill Posters
Apr 2nd, 2007, 08:00 AM
Use Css!
Yay! Another one who's missed the point.

It's far better to use appropriate, semantic markup (and then use CSS to restyle if desired/necessary) than to use semantically neutral elements (e.g. span) to which you then add style, but no meaning.

The idea/ideal is that the markup conveys meaning regardless of the presence of CSS.

Apr 2nd, 2007, 12:38 PM
There's quite a useful XHTML cheat sheet (http://csstidy.sourceforge.net/xhtml.php) (put together by Florian Schmitz - I only take the credit for bringing it to your attention :) ) on CSSTidy, which is pinned to my wall.

Apr 2nd, 2007, 03:50 PM
I think <u> is not available for validation in strict and xhtml 1.1.
ins will validate at all doctypes.