Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我如何在CSS中安排这个?_Css_Twitter Bootstrap 3 - Fatal编程技术网

我如何在CSS中安排这个?

我如何在CSS中安排这个?,css,twitter-bootstrap-3,Css,Twitter Bootstrap 3,我不知道如何恰当地表达这个问题,所以请耐心听我解释 我正在设计一个两列但有三个div的布局,并使用Bootstrap框架。第一个div向右推,第二个div向左拉。第三个div我想把它拉到右边,和第一个div的底部齐平。现在第三个div的顶部位于第二个div的底部 <div class="container"> <div class="div1">DIV1. This will be on the right</div> <div clas

我不知道如何恰当地表达这个问题,所以请耐心听我解释

我正在设计一个两列但有三个div的布局,并使用Bootstrap框架。第一个div向右推,第二个div向左拉。第三个div我想把它拉到右边,和第一个div的底部齐平。现在第三个div的顶部位于第二个div的底部

<div class="container">
    <div class="div1">DIV1. This will be on the right</div>
    <div class="div2">DIV2. This will be on the left</div>
    <div class="div3">DIV3. This will be on the right</div>
</div>
我之所以希望这样安排,是因为在桌面上查看时会有两列,但在移动设备上查看时会缩小到一列,第三个分区将位于第二个分区的内容下方

<div class="container">
    <div class="div1">DIV1. This will be on the right</div>
    <div class="div2">DIV2. This will be on the left</div>
    <div class="div3">DIV3. This will be on the right</div>
</div>

第一组。这个在右边
第二组。这个在左边
第三组。这个在右边

完整CSS在此:

删除
位置:相对属性或将其添加到容器中。然后实际使用
float:rightdiv1
div3
并删除右/左属性:

    .container {
        width: 400px;
        height: 250px;
        background: #ccc;
    }
    .div1 {
        width: 100px;
        height: 100px;
        background: #eee;
        float: right;
    }
    .div2 {
        width: 300px;
        height: 200px;
        background: #aaa;
        float: left;
    }
    .div3 {
        width: 100px;
        height: 100px;
        background: #777;
        float: right;
    }

请参见删除
位置:相对属性或将其添加到容器中。然后实际使用
float:rightdiv1
div3
并删除右/左属性:

    .container {
        width: 400px;
        height: 250px;
        background: #ccc;
    }
    .div1 {
        width: 100px;
        height: 100px;
        background: #eee;
        float: right;
    }
    .div2 {
        width: 300px;
        height: 200px;
        background: #aaa;
        float: left;
    }
    .div3 {
        width: 100px;
        height: 100px;
        background: #777;
        float: right;
    }
请参见

视图 删除
位置:类
.div2{…}
.div3{…}
中的相对属性

.div3{…}
类中的属性值
float:left
更改为
float:right
,以存档此属性

.div2 {
    width: 300px;
    height: 200px;
    background: #aaa;
    right: 100px;
    float: left;
    position: relative;      /* Remove this */
}
.div3 {
    width: 100px;
    height: 100px;
    background: #777;
    left: 300px;
    float: left;             /* Set float Right */
    position: relative;      /* Remove this */
}
看法 删除
位置:类
.div2{…}
.div3{…}
中的相对属性

.div3{…}
类中的属性值
float:left
更改为
float:right
,以存档此属性

.div2 {
    width: 300px;
    height: 200px;
    background: #aaa;
    right: 100px;
    float: left;
    position: relative;      /* Remove this */
}
.div3 {
    width: 100px;
    height: 100px;
    background: #777;
    left: 300px;
    float: left;             /* Set float Right */
    position: relative;      /* Remove this */
}

查看此演示:
您应该删除以下所有css属性:
位置:相对;左…

并设置正确的
float
属性,如下所示:

.div1 {
    width: 100px;
    height: 100px;
    background: #eee;
    float: right;
}
.div2 {
    width: 300px;
    height: 200px;
    background: #aaa;
    float: left;
}
.div3 {
    width: 100px;
    height: 100px;
    background: #777;
    float: right;
}
查看此演示:
您应该删除以下所有css属性:
位置:相对;左…

并设置正确的
float
属性,如下所示:

.div1 {
    width: 100px;
    height: 100px;
    background: #eee;
    float: right;
}
.div2 {
    width: 300px;
    height: 200px;
    background: #aaa;
    float: left;
}
.div3 {
    width: 100px;
    height: 100px;
    background: #777;
    float: right;
}

第一组。这个在右边
第二组。这个在左边
第三组。这个在右边
.集装箱{
宽度:400px;
高度:250px;
背景:#ccc;
}
.1分部{
宽度:100px;
高度:100px;
背景:#eee;
左:300px;
浮动:对;
}
.第2分部{
宽度:300px;
高度:200px;
背景:#aaa;
右:100px;
浮动:左;
}
.第3分部{
宽度:100px;
高度:100px;
背景:#777;
左:300px;
浮动:对;
}

第一组。这个在右边
第二组。这个在左边
第三组。这个在右边
.集装箱{
宽度:400px;
高度:250px;
背景:#ccc;
}
.1分部{
宽度:100px;
高度:100px;
背景:#eee;
左:300px;
浮动:对;
}
.第2分部{
宽度:300px;
高度:200px;
背景:#aaa;
右:100px;
浮动:左;
}
.第3分部{
宽度:100px;
高度:100px;
背景:#777;
左:300px;
浮动:对;
}

请上传一张你想要得到的结果的图,很难理解请上传一张你想要得到的结果的图,很难理解我看了一下演示,非常完美。我明天必须检查,以确保我可以让它与引导工作,但我不认为这将是一个问题。谢谢我看了一下演示,它非常完美。我明天必须检查,以确保我可以让它与引导工作,但我不认为这将是一个问题。谢谢