Bootstrap 3自定义css类取决于设备 [英] Bootstrap 3 custom css class depending of devices

查看:93
本文介绍了Bootstrap 3自定义css类取决于设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在div上设置高度,我想将其设置为相对于设备屏幕。

I need to set a height on a div and i would like to set it relative to the device screen.

例如:

/*Extra small devices Phones (<768px)*/
.myClass { height: 200px; }

/*Small devices Tablets (≥768px)*/  
.myClass { height: 400px; }

/*Medium devices Desktops (≥992px)*/    
.myClass { height: 600px; }

/*Large devices Desktops (≥1200px)*/
.myClass { height: 800px; }


推荐答案

@media screen and (max-width: 768px){
  .myClass{
    height:200px;
  }
}

这篇关于Bootstrap 3自定义css类取决于设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆