如何在小型设备中添加div之间的边框底部而不影响大型设备

时间:2017-04-27 06:42:11

标签: twitter-bootstrap-3

在大型设备边框右侧应显示,小型设备边框底部应显示而不影响大型设备和小型设备之间的一些间距

3 个答案:

答案 0 :(得分:0)

您应该将媒体查询添加到小型设备



  @media only screen and (max-width: 300px)
 {
 your div name 
{
    border-style: solid;
    border-bottom: thick dotted #ff0000;
 }
}




答案 1 :(得分:0)

<div class="col-sm-6">
    <div class="box">
    ...
    </div>
</div>

<div class="col-sm-6">
    <div class="box">
    ...
    </div>
</div>

<style>
.box{ border-right:#000 solid 1px;}

/*Small Screen - below 768 resolution device*/
@media only screen and (max-width: 768px){.box{border-right:none; border-bottom:#000 solid 1px; margin-bottom:20px;}}
</style>

答案 2 :(得分:0)

<div class="col-sm-6">
    <div class="box">
    ...
    </div>
</div>

<div class="col-sm-6">
    <div class="box">
    ...
    </div>
</div>

<style>
/*Desktop*/
.box{ border-right:#000 solid 1px;}

/*Small Screen - below 768 resolution device*/
@media only screen and (max-width: 768px){
    .box{border-right:none; border-bottom:#000 solid 1px; margin-bottom:20px;}
}
</style>