4.21.3 下拉菜单样式主题

在下拉菜单里,针对li里的a链接进行了两种类似的增强,分别如下。

❑默认的a链接。在hover和focus状态下的背景色和背景图标设置如下:

  1. // 源码151行
  2. .dropdown-menu > li > a:hover,
  3. .dropdown-menu > li > a:focus {
  4. background-color: #e8e8e8;
  5. background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
  6. background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
  7. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',
  8. endColorstr='#ffe8e8e8', GradientType=0);
  9. background-repeat: repeat-x;
  10. }

❑高亮的a链接。在hover和focus状态下的背景色和背景图标设置如下:

  1. // 源码159行
  2. .dropdown-menu > .active > a,
  3. .dropdown-menu > .active > a:hover,
  4. .dropdown-menu > .active > a:focus {
  5. background-color: #357ebd;
  6. background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
  7. background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
  8. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',
  9. endColorstr='#ff357ebd', GradientType=0);
  10. background-repeat: repeat-x;
  11. }