css - 在 Bootstrap 容器中移动内容的正确方法

标签 css twitter-bootstrap

如果我使用容器。例如 然后我使用相对位置。相对位置会通过左右移动弄乱容器。当我指定网格然后四处移动内容时,这不会导致设备呈现问题吗? 在不弄乱我用 col-md-#/col-sm-# 设置的网格的情况下移动内容的正确方法是什么

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;{{"Andy's Bike Shop"}}</span></i>
</div>
</div>
    </div><!--Header Container-->
    </div>
<div class="bikeSelector">
        <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 class="col-md-offset-2 col-md-10"><!-- you missed md from offset, end class not needed -->

          Test

    </div>
 </div>


</div>
</div> 


<script src="bower_components/angular/angular.js"></script>
<script src="app.js"></script>
</body>
</html>

CSS

.products {
    position :relative;
    left: 500px;
}

enter image description here

最佳答案

对于您要实现的目标,您的 html 在某些地方是错误的。

试试这个(未经测试但应该让你开始)

<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 class="col-md-offset-2 col-md-10"><!-- you missed md from offset, end class not needed -->
        <div class="products">
            {{bike.name}}
        </div>
    </div>
 </div><!--bike controller row-->

Here's a bootply which is a great way to test before you add

关于css - 在 Bootstrap 容器中移动内容的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38205871/

相关文章:

jquery - 观察 DOM 元素的变化

css - Bootstrap 4alpha - 更改移动/桌面/平板电脑的 Logo

twitter-bootstrap - 如何让 Twitter Bootstrap 的 Scrollspy 插件与 LazyLoad 配合使用

javascript - 使用 javascript 困难生成 html

html - 针对不同的移动屏幕分辨率呈现带有文本的横幅图像

html - 菜单上的一个超链接不起作用

html - Chrome 边框下方的空白区域

html - Bootstrap,无法将导航栏元素移动到最左侧

html - 模拟灵活宽度

html - 我正在寻找与我给定的图像相似的标签