a标签去下划线 菜鸟教程

HTML provides different styling options for the text. Underlining the HTML text is one of them. Simply underlining will draw a straight line under the text without occupying the line below. In this tutorial, we will learn the how-to underline the HTML text with <u> tag, CSS code, CSS class, and set the underlining properties and alternatives.

HTML为文本提供了不同的样式选项。 强调HTML文本就是其中之一。 简单的下划线将在文本下方绘制一条直线,而不会占用下面的线。 在本教程中,我们将学习如何使用<u>标签,CSS代码,CSS类在HTML文本下划线,并设置下划线属性和替代方法。

带<u>标记的下划线文本 (Underline Text with <u> Tag)

HTML provides the <u> tag in order to underline the given text in HTML. <u> is the start tag for underlining and </u> is used to set the end of the underline. Underline tags can be used for different text types like hyperlinks, bold text, etc without a problem. In the following example, we will underline a single word or complete sentence or a hyperlink. The <u> or underline HTML tag is supported by all major browsers like Google Chrome, Mozilla Firefox, Microsoft Edge, Safari, or Opera.

HTML提供<u>标记,以便在HTML中给定的文本加下划线。 <u>是下划线的开始标记,</ u>用于设置下划线的结束。 下划线标签可用于各种文本类型,例如超链接,粗体文本等,而不会出现问题。 在以下示例中,我们将在单个单词或完整句子或超链接下划线。 所有主要浏览器(例如Google Chrome,Mozilla Firefox,Microsoft Edge,Safari或Opera)都支持<u>或下划线HTML标签。

<html>
<body><h1>HTML Text Underline Example</h1><p>I like <u>poftut.com</u></p><p><u>I like poftut.com</u></p><p>I like <u><a href="https://www.poftut.com">poftut.com</a></u></p><p><u><a href="https://www.poftut.com">I like poftut.com</a></u></p></body>
</html>

带CSS文本修饰属性的下划线文本 (Underline Text with CSS text-decoration Attribute)

CSS provides the text-decoration attribute in order to underline different HTML elements. We can use the text-decoration attribute in order to underline HTML text. The text-decoration style attribute can be used with different HTML tags or elements. In the following example we have used the <span> tag to select the text and underline it.

CSS提供了text-decoration属性,以便在不同HTML元素下划线。 我们可以使用text-decoration属性为HTML文本加下划线。 文本装饰样式属性可以与不同HTML标签或元素一起使用。 在下面的示例中,我们使用了<span>标记来选择文本并在其下划线。

<html>
<body><h1>HTML Text Underline Example</h1><p>I like <span style="text-decoration:underline">poftut.com</span></p><p><span style="text-decoration:underline">I like poftut.com</span></p><p>I like <span style="text-decoration:underline"><a href="https://www.poftut.com">poftut.com</a></span></p><p><span style="text-decoration:underline"><a href="https://www.poftut.com">I like poftut.com</a></span></p></body>
</html>

Underline Text with CSS text-decoration Attribute
带CSS文本修饰属性的下划线文本

设置文字下划线颜色和样式(Set Text Underline Color and Style)

In some cases just underlining the HTML text may not enough. We can also color or change the style of the underline. CSS attribute text-decoration can be used to style and color the underlines with the <u> tag or without it. Below we will provide the HTML text underline color as red, green and the style as wavy, dashed, dotted, and double.

在某些情况下,仅对HTML文本加下划线可能还不够。 我们还可以为下划线上色或更改其样式。 CSS属性text-decoration可用于带有<u>标记或不带有<u>标记的下划线样式和颜色。 在下面,我们将提供HTML文本下划线颜色为红色,绿色,以及样式为波浪形,虚线,点划线和双精度。

wavy style will create the not a straight line where the line will be wavy like waves.

wavy将创建一条非直线,直线将像波浪一样呈波浪形。

dashed style will create dashed underline.

dashed样式将创建虚线下划线。

dotted style is similar to the dashed but the points will be smaller.

dotted样式与虚线类似,但点数较小。

double style will put two underlines where default is single underline.

double样式将放置两个下划线,其中默认为单个下划线。

The red color and dashed underline can be used for expressing spelling, syntax or general errors. Also dotted

红色和带下划线的下划线可用于表示拼写,语法或常规错误。 也dotted

<html>
<body><h1>HTML Text Underline Example</h1><p>I like <u style="text-decoration: red underline">poftut.com</u></p><p><u style="text-decoration: red wavy underline">I like poftut.com as wavy</u></p><p><u style="text-decoration: green wavy underline">I like poftut.com as wavy</u></p><p>I like <u style="text-decoration: red dashed underline">poftut.com as dashed</u></p><p><u style="text-decoration: red dotted underline">I like poftut.com as wavy</u></p><p><u style="text-decoration: red double underline">I like poftut.com as wavy</u></p></body>
</html>

将CSS类用于HTML文本下划线 (Use CSS Class For HTML Text Underline)

Writing every underline CSS code, again and again, is not good work. A CSS class can be created for different underline use cases and this class can be used for HTML text underline with other HTML tags. In the following example we will create different CSS classes like underline-red, underline-green to create text underline easily.

一次又一次地写下划线CSS代码并不是一件好事。 可以为不同的下划线用例创建CSS类,并且该类可用于带有其他HTML标记HTML文本下划线。 在下面的示例中,我们将创建不同CSS类(例如,下划线红色,下划线绿色)以轻松创建文本下划线。

<html>
<head><style>.underline-red { text-decoration: red underline;}.underline-green { text-decoration: green underline;}</style>
</head>
<body><h1>HTML Text Underline Example</h1><p class="underline-red">I like poftut.com</p><p class="underline-green">I like poftut.com</p></body>
</html>

Use CSS Class For HTML Text Underline
将CSS类用于HTML文本下划线

翻译自: https://www.poftut.com/html-underline-tag-tutorial-with-examples/

a标签去下划线 菜鸟教程

a标签去下划线 菜鸟教程_HTML下划线标签示例教程相关推荐

  1. html中b标签去加粗,html中b加粗标签的详细介绍

    html作为网页最基础的语言是每一个站长必学的语言,今天我们就来了解字体文本标签 b,/b标签的用法及其语义. 字体文本标签讲解标签 字体标签定义字体的显示效果,有些标签它有独自的语义. 标签 感谢您 ...

  2. android实例教程_Android共享首选项示例教程

    android实例教程 In this tutorial we'll use Shared Preferences in our android application to store data i ...

  3. linux命令实例教程,Linux xxd命令入门示例教程

    你是否需要使用二进制或十六进制格式显示文件内容? 寻找可以执行此操作的命令行实用程序? 那,你很幸运,因为存在一个名为xxd的命令可以为你做到这一点. 在本教程中,我们将使用一些易于理解的示例来讨论x ...

  4. Hibernate Criteria示例教程

    Hibernate Criteria示例教程 欢迎使用Hibernate Criteria示例教程.今天我们将研究Hibernate中的Criteria. Hibernate Criteria 大多数 ...

  5. Hibernate Validator JSR303示例教程

    Hibernate Validator JSR303示例教程 欢迎使用Hibernate Validator示例教程.数据验证是任何应用程序的组成部分.您将使用Javascript在表示层找到数据验证 ...

  6. Spring IoC,Spring Bean示例教程

    Spring IoC,Spring Bean示例教程 欢迎来到Spring IoC示例教程.Spring Framework基于Inversion of Control原理.依赖注入是在应用程序中实现 ...

  7. htmla标签下划线去除_html超链接的下划线怎么去掉?a标签去下划线的方法都在这里...

    本篇文章就是关于html超链接取消下划线的用法,教你如何快速的去掉HTML超链接下划线的方法,最后还有相关代码解释,下面就让我们一起看看这篇文章吧 首先我们使用css的基础样式来做一个最简单的去下划线 ...

  8. a标签去下划线或文字添加下修饰_a标签下划线(如何去掉a标签下划线)

    去掉a标签下划线:对超链接下划线设置 使用代码"text-decoration"语法: text-decoration : none || underline || blink || overline ...

  9. a标签去下划线或文字添加下修饰_怎么去掉html a超链接下划线

    我们在HTML网页制作过程中,相信大家对css文本超链接这个概念并不陌生.我们都知道想要给某段文本或者指定元素添加一个锚点也就是超链接需要用到HTML中的a标签.程序猿的生活:打造全网web前端全栈资 ...

最新文章

  1. oracle多种导入导出数据方法
  2. MPLS的简单配置4
  3. 【消息中间件】浅谈中间件优缺RabbitMQ基本使用
  4. java trrows处理_java 19 -2 异常以及tr...catch()的方法处理异常
  5. mysql安装模块解释_MySQL的模块不能安装的解决方法_MySQL
  6. 系统架构师学习笔记-论文摘要部分的写法
  7. GoAhead服务器编程
  8. MYSQL ALTER命令
  9. layui模板引擎不生效解决方案
  10. 键盘删除键长按只能删除一个字符,因为开启了键盘筛选键功能,解决方法
  11. virtualbox win10 共享文件夹
  12. Phun一个有意思的程序
  13. 1.3 网页数据抓取
  14. hcip hcie认证该如何选择?
  15. 情人节-程序员的乐趣
  16. 第十周 项目三 小学生考试系统
  17. “骚操作”男子看涩情直播打赏3千后报警,多个直播平台窝点被端!
  18. 华为od机考真题-数组拼接
  19. 苹果xr nfc功能不能实现门禁卡的功能
  20. 金蝶K3 WISE 12.1在Windows 2008 R2虚拟机服务器上的配置

热门文章

  1. 纳滤膜让蔗糖精制废水回收变得简单
  2. 论文阅读笔记:Intriguing properties of neural networks
  3. C. The Intriguing Obsession[组合数学]
  4. AirPods Pro好在哪
  5. 基于大数据分析技术在会计方面的研究
  6. What Makes a Great Maintainer of Open Source Projects?
  7. 微信公众号插入百度地址导航功能
  8. 安利:那些让你欲罢不能的宝贝网站
  9. MySQL给表和字段添加注释
  10. Kafka的概念与命令操作