redhillccwebmas — 2006-10-11T05:51:40-04:00 — #1
I have found out from many documents on the net, that the <u> tag isn't supported in the XHTML strict doctype - whats the alternative that can be used for underlining?
splashpoint — 2006-10-11T06:00:03-04:00 — #2
Apply the following rule to a CSS class or id
From a usability POV it's best not to underline anything that isn't a link
redhillccwebmas — 2006-10-11T06:11:57-04:00 — #3
is that the only way of doing it?
splashpoint — 2006-10-11T06:19:26-04:00 — #4
I believe so yes. I suppose you could add a bottom-border if you want, but i don't believe there's a specific tag for it. With XHTML & CSS you should be trying to separate presentation from content anyway (so CSS is the way forward)
zcorpan — 2006-10-11T06:28:28-04:00 — #5
It depends on why you want to underline a piece of text.
Is it a heading? Use <h1>-<h6>.
Is it an emphasized word? Use <em>.
Is it text that has been inserted after a document edit? Use <ins>.
Is it an instance of a term that is being defined? Use <dfn>.
And so forth. If HTML doesn't have an element type for the purpose then use a <span>.
Then you can alter the presentation of that element with CSS as described above.
autisticcuckoo — 2006-10-11T06:45:03-04:00 — #6
The whole idea with Strict doctypes is the separation between content, presentation and behaviour. Underlining is presentation, so it should be handled via CSS.
As Simon said, choose the appropriate element type, add some way to reference it using an ID or class as splashpoint said, and assign a CSS rule to achieve the underlining.
BTW, this applies to HTML 4.01 Strict as well as XHTML 1.0 Strict and XHTML 1.1. It's not an XHTML vs HTML issue, it's a Strict vs Transitional thing.
redhillccwebmas — 2006-10-11T08:04:14-04:00 — #7
Thanks guys for your help
aryandelhi — 2006-10-12T02:24:51-04:00 — #8
style="text-decoration:underline;" is the best option.
stormrider — 2006-10-12T05:45:41-04:00 — #9
no it isn't, inline styles are bad!