更改背景颜色slider-nav

时间:2016-04-08 08:46:21

标签: html css twitter-bootstrap

这是链接

jsFiddle

我希望侧边栏颜色为红色并悬停颜色#C9302C。

这里我尝试了CSS,但是在滚动页面时,侧栏会向下移动..

为什么这样。有什么想法??

<style>
     .sidebar-nav {
width: 250px; /*Changed from max-width: 200px to better fit smaller menu items, but this is up to your preference*/
z-index: 10000;
position: fixed;
min-height: 100%; /*Makes it fit 100% of your pages content*/
background: #EE1B24;
 }
 </style>

3 个答案:

答案 0 :(得分:0)

private int selectedindex;

private void Show_Delete_Button(object sender, SelectionChangedEventArgs e)
{
    FlyoutBase.ShowAttachedFlyout(sender as ListView);
    selectedindex = listView.SelectedIndex;
}

private async void Delete_Data(object sender, RoutedEventArgs e)
{
    var item = mylist.ElementAt(selectedindex);
    mylist.RemoveAt(selectedindex); //remove from listview
    StorageFolder roamingFolder = Windows.Storage.ApplicationData.Current.RoamingFolder;
    StorageFile xmlFile = await roamingFolder.GetFileAsync("XMLList.xml");
    XmlDocument xdoc = await XmlDocument.LoadFromFileAsync(xmlFile);
    XmlElement root = xdoc.DocumentElement;
    string itemstring = item.xmlitem.TrimStart('<');
    itemstring = itemstring.TrimEnd('>', '/');
    root.RemoveChild(root.GetElementsByTagName(itemstring).FirstOrDefault()); //remove from root element.
    await xdoc.SaveToFileAsync(xmlFile); //save the new list
}

SelectionChanged event

答案 1 :(得分:0)

这应该这样做:

  .navbar-default {
    background:red;
    }

  .navbar-default .navbar-nav li a:hover {
    background:#C9302C;
  }

答案 2 :(得分:0)

使用此css覆盖默认的bootstrap css

.navbar-default .navbar-nav > li:hover a{

  color:#C9302C;

}
.navbar-default .navbar-nav > li > a{

  color:#FF0000;

}