菜单
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

HTML <u> 标签


示例

使用 <u> 标签标记拼写错误的单词

<p>This is some <u>mispeled</u> text.</p>
自己动手试一试 »

更多“自己尝试”的例子见下文。


定义和用法

The <u> tag represents some text that is unarticulated and styled differently from normal text, such as misspelled words or proper names in Chinese text. The content inside is typically displayed with an underline. You can change this with CSS (see example below). 

提示: 避免使用 <u> 元素,因为它可能被误认为是超链接!


浏览器支持

元素
<u>

全局属性

The <u> tag also supports the HTML 中的全局属性.


事件属性

The <u> tag also supports the HTML 中的事件属性.



更多示例

示例

使用 CSS 设置拼写错误文本的样式

<html>
<head>
<style>
.spelling-error {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: red;
}
</style>
</head>
<body>

<p>This is some <u class="spelling-error">mispeled</u> text.</p>

</body>
</html>
自己动手试一试 »

相关页面

HTML 教程:HTML 文本格式化

HTML DOM 参考: Underline Object


默认 CSS 设置

Most browsers will display the <u> element with the following default values

示例

u {
  text-decoration: underline;
}
自己动手试一试 »


×

联系销售

如果您想将 W3Schools 服务用于教育机构、团队或企业,请发送电子邮件给我们
sales@w3schools.com

报告错误

如果您想报告错误,或想提出建议,请发送电子邮件给我们
help@w3schools.com

W3Schools 经过优化,旨在方便学习和培训。示例可能经过简化,以提高阅读和学习体验。教程、参考资料和示例会不断审查,以避免错误,但我们无法保证所有内容的完全正确性。使用 W3Schools 即表示您已阅读并接受我们的使用条款Cookie 和隐私政策

版权所有 1999-2024 Refsnes Data。保留所有权利。W3Schools 由 W3.CSS 提供支持