无法将图像移动到bootstrap网格中的下一个col

时间:2016-07-08 19:27:17

标签: angularjs twitter-bootstrap

我正在尝试使用col-md-offset-1来使用col-md-offset-1将内容推到左箭头右侧,但内容永远不会移动。我试图让它全部居中,但左箭头太靠近第一辆自行车了。我似乎无法弄清楚为什么它没有移动,因为我留下了12列。有什么建议。 enter image description here

HTML

<!DOCTYPE html>
<html ng-app='formApp'>

<head>
    <title>Bicycle App</title>
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link href="app.css" rel="stylesheet">

</head>

<body>
    <div class="header">
        <div class="container">
            <div class='row'>

                <div class='col-md-12'>

                    <i class="fa fa-bicycle" aria-hidden="true"><span>&nbsp;{{"Bike Shop"}}</span></i>
                </div>
            </div>
        </div>
    </div>
    <div class="container">


        <div class="row">

            <div class="col-md-offset-3 col-md-6">
                <!-- end class not needed -->
                <div class="chooseTitle">
                    Choose Your Bicycle
                </div>
            </div>
            </div>
                <!-- you missed md from offset, end class not needed -->
                <div class="products" ng-controller="BikeController">
                <div class="row">

     <div class="col-md-1"><img ng-src="images/leftarrow.png"></div>
     <div class="col-md-offset-1"></div>
                  <div class="col-md-3 text-center" ng-repeat="product in products | limitTo:-3">
                  {{product.manufacturer}}
                  <img id="bikePic" ng-src="{{product.image}}">
                  </div>
                   <div class="col-md-1"><img ng-src="images/rightarrow.png"></div>
                  </div>




                </div><!--End controller-->




    </div>



    <script src="bower_components/angular/angular.js"></script>
    <script src="app.js"></script>
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <script src="bikeimageslider.js"></script>
</body>

</html>

CSS

.header{
    font-style:italic;
background-color:black;
height:60px;
color:white;
font-weight:bold;
font-size:40px;
position:relative;
padding-top:10px;
padding-left:16px;
margin-left:-10px;
 margin-right:-10px;
margin-top:-10px;

}
.header .fa {font-style:italic;
}
.bikeSelector{
color:green;
}
.chooseTitle{

font-size:60px;

}

.products{
color:  #1E90FF  ;
text-align:center;
font-size:40px;

}
#bikePic{

height:100%;
width:100%;

}
#bikePic, .products {
margin-top:40px;

}

1 个答案:

答案 0 :(得分:0)

您可以使用网格嵌套来缩小12列,这是您在这种情况下需要做的事情,以使整个布局居中...

http://codeply.com/go/4TkFUey6k9

注意:您所拥有的CSS覆盖将无法响应。