0

我的子 div 有右边框,但我想从最后一个 div 中删除右边框。

这是HTML

         <div class="nav-footer">

            <div class="col-lg-2">
              <h2 class="light-blue">Who</h2>
              <p class="white">are the people/ would you drink with</p>
            </div>
            <div class="col-lg-2">
              <h2 class="light-blue">Where</h2>
              <p class="white">would be having a hangover</p>
           </div>
            <div class="col-lg-2">
              <h2 class="light-blue">What</h2>
              <p class="white">would you be working on</p>
            </div>
             <div class="col-lg-2">
              <h2 class="light-blue">How</h2>
              <p class="white">does a team drink</p>
            </div>
             <div class="col-lg-2">
              <h2 class="light-blue">Why</h2>
              <p class="white">should you drink</p>
            </div>
             <div class="col-lg-2">
              <h2 class="light-blue">Show</h2>
              <p class="white">at Vegas</p>
            </div>
        </div>

CSS

.nav-footer .col-lg-2       { border-right: 1px solid #ffffff;}
.nav-footer .col-lg-2 .last { border-right:none; }

它不是那样工作的......

谢谢。

4

1 回答 1

3

我相信您打算使用 :last-child选择器:

.nav-footer .col-lg-2:last-child

jsFiddle 示例在这里。

于 2013-10-22T18:15:03.690 回答