[英]HTML/CSS - Text-decoration does not work
I'm a beginner of HTML and CSS. 我是HTML和CSS的初学者。 So, now I'm in trouble.
所以,现在我有麻烦了。 The
text-decoration: none;
text-decoration: none;
does not work for me. 对我不起作用。 Can you guys help me to find a solution?
你们可以帮我找到解决方案吗?
* { margin: 0px; padding: 0px; } #Header { width: auto; height: 70px; background-color: #647551; margin-left: 0px; } #Header ul li { text-decoration: none; color: #645789; float: left; margin-left: 30px; }
<!DOCTYPE html> <html> <head> <link href="css/Main.css" type="text/css" rel="stylesheet" /> <meta charset="utf-8"> <title>Talkody - Gilles </title> </head> <body> <div id="Header"> <ul> <li>Home</li> <li>About</li> <li>Portfolio</li> <li>Contact</li> </ul> </div> <p>Dit is een test website waar ik alles uittest, hierna ga ik er verder op in</p> <img source="images/Logo/TalkodyLogo.ai" /> </body> </html>
The text has no decoration already, so if what you want it's to remove the bullets from the list, then use: 该文本尚无修饰,因此,如果要从列表中删除项目符号,请使用:
ul {
list-style-type: none;
}
When you want to remove bullets from ul try: 当您想从ul中删除项目符号时,请尝试:
#header ul {
list-style-type: none;
}
When you want to delete underline from links use: 如果要从链接中删除下划线,请使用:
#header li a {
text-decoration: none;
}
You need to apply list-style-type: none;
您需要应用
list-style-type: none;
to remove bullets 去除子弹
See below: 见下文:
* { margin: 0px; padding: 0px; } #Header { width: auto; height: 70px; margin-left: 0px; } #Header ul li { text-decoration: none; color: #645789; float: left; margin-left: 30px; list-style-type: none; }
<body> <div id="Header"> <ul> <li>Home</li> <li>About</li> <li>Portfolio</li> <li>Contact</li> </ul> </div> <p>Dit is een test website waar ik alles uittest, hierna ga ik er verder op in</p> <img source="images/Logo/TalkodyLogo.ai" /> </body>
text-decoration: none;
will remove below text decorations 将删除下面的文字装饰
underline Defines a line below the text
overline Defines a line above the text
line-through Defines a line through the text
You want to add this to your CSS : 您要将其添加到CSS中:
#header ul {
list-style:none;
}
* { margin: 0px; padding: 0px; } #Header { width: auto; height: 70px; background-color: #647551; margin-left: 0px; } #Header ul li { text-decoration: none; color: #645789; float: left; margin-left: 30px; list-style:none; }
<!DOCTYPE html> <html> <head> <link href="css/Main.css" type="text/css" rel="stylesheet" /> <meta charset="utf-8"> <title>Talkody - Gilles </title> </head> <body> <div id="Header"> <ul> <li>Home</li> <li>About</li> <li>Portfolio</li> <li>Contact</li> </ul> </div> <p>Dit is een test website waar ik alles uittest, hierna ga ik er verder op in</p> <img source="images/Logo/TalkodyLogo.ai" /> </body> </html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.