2017-02-17 19 views
0

當涉及到刪除「下劃線」時,我嘗試了幾乎所有方法。但我無法刪除它。我想從錨標記中刪除下劃線。我正在提供我的HTML和CSS代碼。text-decoration:錨定標記上的任何內容都不起作用

HTML:

<html> 
    <head> 
    <meta> 
     <link rel="stylesheet" href="css/bootstrap.min.css"> 
     <link rel="stylesheet" href="css/style.css"> 
     <link href="https://fonts.googleapis.com/css?family=Caveat+Brush|Permanent+Marker" rel="stylesheet"> 
    </head> 
    <body> 

     <nav> 
      <h1>ABC<br> DEF</h1> 
     <ul> 
      <li><a href="#facilities">One</a></li> 
      <li a href="#location"><a>Two</a></li> 
     </ul> 
     </nav> 
     <!--Photo comes here--> 



     <!--Can Contact me goes here--> 


</body> 
</html> 

CSS:

/*Custom CSS starts from here*/ 


body { 
    font-family: 'Caveat Brush'; 
} 

h1 { 
    font-size: 72px; 
} 

ul { 
    list-style-type: none; 
    font-size: 32px; 
    margin: 0px; 
    padding: 0px; 
} 

a { 
    display: block; 
    width: 120px; 
    text-decoration: none; 
    text-transform: uppercase; 
} 
+0

請加上你的CSS以及。 –

+0

我很抱歉。我忘了。我補充說。 –

+0

你的代碼正在爲我工​​作http://codepen.io/anon/pen/ZLZgeO – d3orn

回答

1

您可以簡單地使用text-decoration: none。可能需要使用!important以更高的優先級覆蓋它。

li a { 
    text-decoration: none !important; 
} 

我無法重現您提供的代碼所面臨的問題。

這裏是供您參考小提琴:https://jsfiddle.net/oqoajzbp/

+0

終於搞定了。 –

+0

很高興爲你效勞 –