通过CSS删除最后一个Child div的右边框 [英] Remove right border off of the last Child div through CSS

查看:75
本文介绍了通过CSS删除最后一个Child div的右边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的孩子div右边有边框,但我想从最后一个div上删除右边边框.

I have right border with my child divs but I want to remove the right border from the last div.

         <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; }

它不是那样工作的...

It doesn't work like that ...

谢谢.

推荐答案

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

I believe you meant to use the :last-child selector:

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

此处的jsFiddle示例.

这篇关于通过CSS删除最后一个Child div的右边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆