为什么我在使用 元素时会在 Visual Studio 中收到以下消息?
"Element 'u' is considered outdated. A newer construct is recommended"
老化了吗?
最佳答案
从 HTML4 开始,下划线标签已被弃用。可以找到 W3C 引用 here .原因是视觉样式不属于标签,而应移至样式表。
您可以改用text-decoration: underline
样式:
<span style="text-decoration: underline">some underlined text</span>
要删除下划线,请使用 text-decoration:none
禁用下划线。
关于html - 为什么元素 <u> 根据 VS2008 被认为是过时的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1078912/