In HTML, you can use the style attribute to add the "text-decoration:none;" style to the element to set the element to hide the underline. The syntax is "
".
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
html5How to hide the underline
In html, you can set the style attribute of the element and add the "text-decoration:none" style to the element You can hide the underline of the element.
Let’s take the a tag as an example to see how to hide the underline of the a tag. The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <a href="//m.sbmmt.com/" target="_blank" style="text-decoration: none;">这是一个a标签</a> </body> </html>
Output result:
In the above example, using the style attribute to add the "text-decoration: none" style to the element can hide the underline of the element.
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to hide underline in html5. For more information, please follow other related articles on the PHP Chinese website!