html - 为什么元素 <u> 根据 VS2008 被认为是过时的?

标签 html visual-studio-2008

为什么我在使用 元素时会在 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/

相关文章:

javascript - HTML 模板不会根据页面 URL 加载。这是为什么?

visual-studio-2008 - Visual Studio 2008 中的 Unicode 调试可视化工具

jquery - 在运行时更改 KendoPanel 的颜色

visual-studio - 此安装不支持该项目类型

c# - 组合框的 ASPX 回发问题

visual-studio-2008 - 如何让 VS2008 粘贴代码而不重新格式化(更改空格)?

asp.net - 错误渲染控件缓存不可用

html 框架 css

javascript - 发送 HTML 代码到 gmail

javascript - 选中复选框时提交表单并使用 POST 获取数据