【发布时间】:2017-02-07 02:57:10
【问题描述】:
您好,我目前正在尝试弄清楚如何在使用 Bootstrap 时让两个类并排浮动,我希望完成的是让我的文本向左浮动,图像向右浮动!这是我的代码:
<div class="row-fluid">
<div id="test-1" class="span6"></div>
<div id="test-2" class="span6"></div>
</div>
body {
background-color: black;
}
#test-1 {
background-color: white;
height: 200px;
width: 200px;
}
#test-2 {
background-image: url("http://www.rd.com/wp-content/uploads/sites/2/2016/04/01-cat-wants-to-tell-you-laptop.jpg");
background-size: cover;
background-repeat: no-repeat;
height: 200px;
width: 200px;
}
【问题讨论】:
-
您的意思是 img 在区域右侧,文本在区域左侧?然后你应该使用 bootstrap 的 pull-left 和 pull-right 类
-
@sagar 是的,没错
-
您实际使用的是哪个版本的 Bootstrap?
标签: html css twitter-bootstrap