0

我正在用 css 设计一个下拉列表这是我的 html 代码:

在此处输入图像描述

我已将每个li a属性border-right 设置为border-right:1px dashed silver;我想删除最后一个li a元素的那个属性

这是CSS代码:

 #navigation
 {
  display:inline-table;
  text-align:center;
  background:silver;
 }
#navigation li
 {
 float:left;
 list-style:none;
 padding:2px 10px 2px 10px;
 }
#navigation a 
 {
 display:block;
 text-decoration:none;
 color:green;
 font-weight:bold;
 padding:5px;
 border-right:1px dashed green;
 }
.noBorder
{
display:block;
text-decoration:none;
color:red;
font-weight:bold;
padding:5px;
border:0px;
}
#navigation a:hover
{
color:yellow;
background:black;
 }

我想删除最后一个列表的右边框,software Developments 所以我尝试过 noBorder上课。但不能给出任何解决方案请任何人告诉我提前谢谢

4

4 回答 4

3

不确定您在说哪个边框,但如果您想从最后一个边框移除,请尝试此操作li

.noBorder {
   border-right: none !important;
}
于 2012-12-08T05:52:56.780 回答
0

你可以这样做

border:  none !important;

它将删除所有边框

仅尝试删除右边框

border-right: none !important;

好读

!important 对性能有害吗?

于 2012-12-08T05:50:29.410 回答
0

试试这个,它会工作

.noBorder
{
border-right:0px!important;
}
于 2012-12-08T05:55:09.093 回答
-1
#navigation {
    display: inline - table;
    text - align: center;
    background: silver;
}
#navigationli {
    float: left;
    list - style: none;
    padding: 2px 10px 2px 10px;
}
 #navigationa {
    display: block;
    text - decoration: none;
    color: green;
    font - weight: bold;
    padding: 5px;
    border - right: 1px dashed green;
}
 .noBorder {
    display: block;
    text - decoration: none;
    color: red;
    font - weight: bold;
    padding: 5px;
    border: 0px;
}
 #navigationa: hover {
    color: yellow;
    background: black;
}
于 2012-12-08T05:50:05.470 回答