格式化导航栏颜色并在Razor中添加分隔线

时间:2015-06-23 16:51:27

标签: c# css asp.net-mvc visual-studio

对于我的第一个项目,我完成了最后几件事。现在,我正在尝试编辑导航栏。它目前看起来像这样:

Current Navbar

但是,我希望它看起来像这样(主要是):

enter image description here

我要复制的内容是:

  1. 添加|每次选择后的字符
  2. 将导航栏颜色更改为该颜色
  3. 将字体颜色更改为白色
  4. 更改字体样式
  5. 以下是我的Navbar操作链接的代码:

    <li>@Html.ActionLink("Create Ticket", "Create", "Ticket")</li>
    <li>@Html.ActionLink("Open On Behalf", "ChooseOpenBehalf", "Ticket")</li>
    <li>@Html.ActionLink("Search Tickets", "ChooseSearchView", "Ticket")</li>
    <li>@Html.ActionLink("Open Ticket", "GetTicket", "Ticket")</li>
    <li>@Html.ActionLink("Knowledgebase", "ChooseSearchView", "Knowledgebase")</li>
    <li class="dropdown">
       <a href="#" class="dropdown-toggle" data-toggle="dropdown">User<b class="caret"></b></a>
      <ul class="dropdown-menu">
          <li>@Html.ActionLink("View Open Tickets", "Index", "Ticket")</li>
          <li>@Html.ActionLink("View Deffered Tickets", "DefferedTickets", "Ticket")</li>
          <li>@Html.ActionLink("View Closed Tickets", "ClosedTickets", "Ticket")</li>
                                                </ul>
                                            </li>
    

    这是我尝试更改导航栏颜色的CSS:

    .navbar-fixed-top {
        background-image: none;
        background-color: #000000;
        color: #ff6a00;
    }
    

    这是我尝试添加边框的CSS:

    .navbar-fixed-top li a{
      border-right: 1px solid;
    }
    
    .navbar-fixed-top li:last-child a{ 
       border-right: none;
    

1 个答案:

答案 0 :(得分:0)

你不能使用简单的CSS添加边框

#navigation li a{
  border-right: 1px solid;
}

#navigation li:last-child a{ 
   border-right: none;
}