为了账号安全,请及时绑定邮箱和手机立即绑定

border属性,没有对齐如何解决??

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>基本用法</title>
    <link rel="stylesheet" href="../bs-3.3.7/css/bootstrap.min.css">
    <style type="text/css">
        /*css属性选择器的写法*/
        [class|=col-md]{
            background: #eeeeee;
            color:red;
            border:1px solid #0d638f;
            margin: -1px 0px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-push-4">col-md-8 push推</div>
        <div class="col-md-4 col-md-pull-8">col-md-4 pull拉</div>
    </div>
</div>
<div class="container">
    <div class="row">
        <div class="col-md-4">
            我是第一个
            <div class="row">
                <div class="col-md-3">1</div>
                <div class="col-md-3">2</div>
                <div class="col-md-3">3</div>
                <div class="col-md-3">4</div>
            </div>
        </div>
        <div class="col-md-8">
            我的里面嵌套一个
            <div class="row">
                <div class="col-md-6">我是第二个</div>
                <div class="col-md-6">我是第二个</div>
            </div>
        </div>
    </div>
</div>




</body>
</html>



https://img1.sycdn.imooc.com//5b54370d0001803612750615.jpg

正在回答

1 回答

左右border叠加了,css样式中添加上这两句(当然,答案不是唯一)

.row>.col-md-8,.row>.col-md-4>.row>.col-md-3, .row>.col-md-8>.row>.col-md-6{
        border-left-width: 0;
  }
.row>.col-md-4>.row>.col-md-3:last-child, .row>.col-md-8>.row>.col-md-6:last-child{
        border-right-width: 0;
}

效果如:https://img1.sycdn.imooc.com//5b5b11f50001b0c511780073.jpg

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

border属性,没有对齐如何解决??

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信