2017-04-11 61 views
1

I have a navigation bar but the problem is i don't know why dots are coming in my nav bar i tried multiple ways but i didn't find the reason for it i don't want those dots to be appear in my nav bar i have uploaded the image also please CLICKHERE to see it and help me, Thanks in advance. here is my Stylesheet code for my nav bar.級聯樣式表導航欄

ul{ 
margin:0px; 
padding:100px; 
padding-left:500px; 

} 
ul li a{ 
    text-decoration:none; 
    color:white; 
    display:block; 
} 
ul li{ 
    float:left; 
    width:200px; 
    height:40px; 
    background-color:black; 
    font-size:20px; 
    line-height:40px; 
    text-align:center; 
    border:1px solid aqua; 
} 
ul li a:hover{ 
    background-color:red; 
} 
HTML Code: 

<!DOCTYPE html> 

<html> 
<head> 
    <meta name="viewport" content="width=device-width" /> 
    <title>Index</title> 
    <link href="~/Scripts/StyleSheet1.css" rel="stylesheet" /> 
</head> 
<body> 
    <div style="background-color:black; height:50px;"> 
     <h2 style ="color:white; font-size:40px; font-family:'Agency FB';">Look up on ZipCodes</h2> 
    </div> 
    <div> 
     <ul> 
      <li><a href="#">Zipcode by City</a></li> 
      <li><a href="#">City by Zipcode</a></li> 
     </ul> 
    </div> 
</body> 
</html> 
+0

可以還顯示或添加HTML代碼? – Grinex

回答

0

需要補充list-style-type:none;到您的UL

ul{ 
    margin:0px; 
    padding:100px; 
    padding-left:500px; 
    list-style-type:none; 
} 
+0

謝謝Mr.Sam,它工作過,但它只在Firefox瀏覽器中工作只有在谷歌瀏覽器它沒有做任何改變,但y? – sundeep

+0

@sundeep檢查我的答案,可能有幫助。 –

0

這是因爲它是一個列表。因此,項目符號點將出現在li本身的任何位置旁邊。

爲了防止發生這種情況,您可以添加{list-style-type: none;}這將刪除項目符號點。

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

到'ul'元素不是'a'元素 –

1

ul標籤有其表是(點)默認的樣式,以便去除其添加list-style-type: none;

ul{ 
    list-style-type: none; 

} 
0

只需在您的ul上放置list-style: none;即可移除所有子彈上榜(點)

檢查下面的代碼段代碼,希望它有助於:)

ul { 
 
     margin: 0px; 
 
     padding: 100px; 
 
     padding-left: 500px; 
 
     list-style: none; /* Remove list bullets */ 
 
    } 
 

 
    ul li a { 
 
     text-decoration: none; 
 
     color: white; 
 
     display: block; 
 
    } 
 

 
    ul li { 
 
     float: left; 
 
     width: 200px; 
 
     height: 40px; 
 
     background-color: black; 
 
     font-size: 20px; 
 
     line-height: 40px; 
 
     text-align: center; 
 
     border: 1px solid aqua; 
 
    } 
 

 
    ul li a:hover { 
 
     background-color: red; 
 
    }
<div style="background-color:black; height:50px;"> 
 
    <h2 style="color:white; font-size:40px; font-family:'Agency FB';">Look up on ZipCodes</h2> 
 
</div> 
 
    
 
<div> 
 
    <ul> 
 
     <li><a href="#">Zipcode by City</a></li> 
 
     <li><a href="#">City by Zipcode</a></li> 
 
    </ul> 
 
</div