2017-02-10 173 views
0

我是HTML和CSS的初学者。 所以,现在我遇到了麻烦。 text-decoration: none;不适合我。 你们能帮我找到一个解决方案吗?HTML/CSS - 文本修饰不起作用

* { 
 
    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>

+1

它没有任何的装饰了。 – bxorcloud

+0

'li'默认没有文字装饰。检查你的CSS的其余部分。 – Turnip

+0

不是吗?我在Chrome中运行它,并在每个单词的开头看到“子弹”。 – Gilles

回答

0

您需要申请list-style-type: none;移除子弹

请看下图:

* { 
 
    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; 

将删除下面的文字装饰

underline  Defines a line below the text 
overline  Defines a line above the text 
line-through Defines a line through the text 
0

的文本有没有装修了,所以如果你想什么它是从列表中删除子弹,然后使用:

ul { 
    list-style-type: none; 
} 
0

当要删除的子弹从ul试试:

#header ul { 
    list-style-type: none; 
} 

当你想要d从链接elete强调使用:

#header li a { 
    text-decoration: none; 
    } 
0

你想要将它添加到您的CSS:

#header ul { 
    list-style:none; 
} 
0

* { 
 
    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>