【问题标题】:Adding arrow to bootstrap dropdown在引导下拉菜单中添加箭头
【发布时间】:2013-10-15 05:57:39
【问题描述】:

我可以弄清楚如何做到这一点。这个话题帮帮我:adding the arrow to dropdown pills for twitter bootstrap?

通过添加

.dropdown-menu::after {
  position: absolute;
  top: -6px;
  left: 10px;
  display: inline-block;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
  border-left: 8px solid transparent;
  content: '';
}

我能够得到箭头显示。但是,箭头顶部没有边框,所以它现在看起来就像下拉菜单中的一个间隙。有谁知道如何将边框添加到向上箭头?

【问题讨论】:

    标签: html css twitter-bootstrap


    【解决方案1】:

    为边框顶部添加规则。像

    border-top: 8px solid white;
    

    【讨论】:

    • 不,这不起作用。只需在箭头顶部放置一条水平线
    • @Anthony 你能分享你的标记和相关的css吗?没有它,我们只能猜测可能出了什么问题。
    【解决方案2】:

    通过添加以下标记解决:

    .savedsearchWrapper .dropdown-menu:after {
      position: absolute;
      top: -6px;
      left: 23px;
      display: inline-block;
      border-right: 6px solid transparent;
      border-bottom: 6px solid #ffffff;
      border-left: 6px solid transparent;
      content: '';
    }
    
    
    .advancedSearchDropDown .dropdown-menu:before {
      position: absolute;
      top: -7px;
      left: 17px;
      display: inline-block;
      border-right: 7px solid transparent;
      border-bottom: 7px solid #ccc;
      border-left: 7px solid transparent;
      border-bottom-color: rgba(0, 0, 0, 0.2);
      content: '';
    }
    

    这些是引导样式,但选择器对于我的实现来说太具体了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-05
      • 1970-01-01
      • 2016-05-20
      • 2014-05-24
      • 2018-07-08
      • 1970-01-01
      相关资源
      最近更新 更多