Why is the <u> element considered deprecated according to VS2008?
Why do I get the following message in Visual Studio when I use the <u> Element?
"The element 'u' is deprecated. A newer construction is recommended."
At the age of?
The underline tag has been deprecated with HTML4. The W3C link can be found here . The reason is that the visual style does not apply to tags, but must be moved to style sheets.
Instead, you can use the text-decoration: underline style:
<span style="text-decoration: underline">some underlined text</span> To remove the underline, use text-decoration:none to turn off the underline.
This is because the W3C decided to abandon it.
This is because all layout and design must be done using CSS. In HTML, ideally, only a structure should exist.
<u> only adds a specific font to the text, but does not contain structural information.
Because according to w3c it was discounted. Read here. Also any style / formatting should answer css, but I am sure that VS follows the recommendations of w3c.
The tag is deprecated along with other text / style formatting elements.
In this case, you need to use the correct layout and apply the style with style sheets.
As others have said, <u> (and similar elements) are deprecated in recent versions of web standards due to the general belief that style and layout should be separated.
And, as others have said, you can make your HTML valid using a range with an inline style. True, though, this is no better. It's really? Yes. But he doesn't buy anything, just using the <u> tags first.
The best semantic decision depends on the context. Why are you trying to insert underline in text? I can recall three uses: headings, links, and text. In each case, you should apply css from the stylesheet to the corresponding semantic element: <h1-6> for headings, <a> for links and <em> for underlined text. If you need variations of each of them, apply css classes and identifiers as needed.
<u> is part of a family of elements that were deprecated. <b> and <i> were replaced by <strong> and <em>, respectively, while css was used to use the effect.
The idea that HTML does not have to decide that something is underlined or in bold, this type of information should be part of the style and, thus, is an ideal candidate for a style sheet.
Not only HTML4, <u> is deprecated in HTML5 .
Interestingly, <b> and <i> are stored as corresponding. You can try to argue on your mailing list or just keep using the tag as you used to. Browsers do not pull support, and you are fine.
I remember why the reason for solving the <u> problem is the lack of a single semantic meaning or something like that. At least when you see bold text, you know that it should be read louder .
there may be a meaning that will be lost to some extent through a CSS link on the u tag.
One minor but annoying result is the ACCESS key for entering controls.
<u>F</u>irst Name <input ... AccessKey="f".. OR
<span class="ul">F</span>irst Name The first method using the tag does indicate a value in which there is no random username assigned by the user. TAGS are fixed - the class name is arbitrary.
As for standards, this difference is no difference. The decision is arbitrary, subjective and moody, transmitted from the alleged experts and purists.
Formatting HTML rather than CSS is deprecated these days. Anyway, if you ever have trouble adhering to standards that reject your formatting in a string, follow these simple search and replace rules:
<b> </b> Replace with <span style = font-weight: bold> </span>
<u> </u> Replace with <span style = text-decoration: underline> </span>
<i </i> Replace with <span style = text-font-style: italic> </span>
<font face = font, otherfont size = number> </font> Replace with <span style = font-family: font, otherfont; font-size: replace-with- keyword> </ & duration GT;
</s> aka <strike </strike> Replace with <span style = text-decoration: line-through>; </ & duration GT;
Keywords for font size: xx-small, x-small, small, medium, large, x-large, xx-large
About the same.
If you just follow these simple replacements, you will experience ...!
- All the joys of adhering to standards! (The rights to boast.)
- None of the benefits. (This CSS will not be modified from a single <style>.)
- All the pain of over-standardization (Wait, what formatting rule repeats this </span> tag). Shit.)
- More bandwidth consumption! (The price of progress, as soon as someone tells me how this helped.)
- Reduced browser support! (I know those people who still use old browsers or minimalistic browsers like LYNX , Links , w3m , OffByOne , etc.? Eh ... who cares?)
Oh yeah...
Addendum : Serious, because today many purist standards just have a tough one for pure CSS. Most of the CSS support that removes the usual markup is generated simply because it's modern, so you should get the time. Another support comes from the fact that CSS is inherently more maintainable and completely ignores unattainable mess like what I suggested above.
It's not that I have something against CSS. The point here is that many people over-preach the standard and will indulge it, even when it is used in wildly unulocal ways. The concept of replacing regular HTML tags with embedded CSS, as I mentioned, is really seen as the progress of too many CSS proponents. It seems that they believe that compliance with the standard, template, design rules is a kind of inalienable asset, and not a rational look at it. Inline formatting has its place, and I think that using regular HTML tags for it is appropriate and more readable.
Those devotees, like people who tell you that gotos are evil, and you should never use them. Those who will look at the regular stack wind and unwind, and instead use indents if the clusterfuck expression is equal to ten layers of indentation and re-code. And they will sincerely view their version as more readable and supported, although by reasonable standards this is clearly not the case. More on this touch: http://kerneltrap.org/node/553/2131