【发布时间】:2020-04-25 06:19:49
【问题描述】:
我是一个绝对的初学者,在创建基本导航栏时,我 我正面临这个问题。我要消除红圈点 与我的列表项相关联。请告诉我我在哪里做错了。 我之前的问题被标记为重复,这个参考是 假如 : I need an unordered list without any bullets 这是我的老问题: Removal of bullets(dots) attached with items in the navigation bar
解决方案指出
list-style-type: none;将解决 问题,我也将此解决方案应用于我的代码,但没有任何改变。
CSS 代码:
*{padding: 0; margin: 0; box-sizing: border-box;}
#Header
{
background-color: #ffad66;
font-family: 'Reem Kufi', sans-serif;
font-weight: 900;
font-size: 50px;
color: #800000;
text-align: center;
height: 120px;
box-sizing: border-box;
padding: 22px;
/* this line was not in my code from the previous question which was marked duplicated and*/
list-style-type: none;
}
.NavItems a
{
text-decoration: none;
list-style: none;
font-size: 14px;
font-weight: bold;
font-family: 'Times New Roman', Times, serif;
color:green;
margin: 10px;
padding: 10px;
}
.NavItems a:hover
{
background-color: #33E3FF;
color: black;
}
.NavBarItem
{
display: flex;
justify-content: center;
}
.MyNavBar
{
width: 100%;
background-color: lightblue;
height: 35px;
box-sizing: border-box;
padding: 8px;
}
HTML 代码: 这是body标签下唯一的一段代码。
<header id="Header">
پوشاک
</header>
<nav class="MyNavBar">
<ul class="NavBarItem">
<li class="NavItems"><a href="#Men">Men</a></li>
<li class="NavItems"><a href="#Women">Women</a></li>
<li class="NavItems"><a href="#Kids">Kids</a></li>
</ul>
</nav>
【问题讨论】:
-
这能回答你的问题吗? I need an unordered list without any bullets