4.21.3 下拉菜单样式主题
在下拉菜单里,针对li里的a链接进行了两种类似的增强,分别如下。
❑默认的a链接。在hover和focus状态下的背景色和背景图标设置如下:
- // 源码151行
- .dropdown-menu > li > a:hover,
- .dropdown-menu > li > a:focus {
- background-color: #e8e8e8;
- background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
- background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',
- endColorstr='#ffe8e8e8', GradientType=0);
- background-repeat: repeat-x;
- }
❑高亮的a链接。在hover和focus状态下的背景色和背景图标设置如下:
- // 源码159行
- .dropdown-menu > .active > a,
- .dropdown-menu > .active > a:hover,
- .dropdown-menu > .active > a:focus {
- background-color: #357ebd;
- background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',
- endColorstr='#ff357ebd', GradientType=0);
- background-repeat: repeat-x;
- }