加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – Bootstrap 3个断点和媒体查询

发布时间:2020-12-17 23:37:04 所属栏目:安全 来源:网络整理
导读:在 http://getbootstrap.com/css/它说: We use the following media queries to create the key breakpoints in our grid system. Extra small devices (phones,up to 480px): No media query since this is the default in Bootstrap Small devices (table
在 http://getbootstrap.com/css/它说:

We use the following media queries to create the key breakpoints in
our grid system.

Extra small devices (phones,up to 480px):
No media query since this is the default in Bootstrap

Small devices (tablets,768px and up):
@media (min-width: @screen-sm) { … }

Medium devices (desktops,992px and up):
@media (min-width: @screen-md) { … }

Large devices (large desktops,1200px and up):
@media (min-width: @screen-lg) { … }

我们应该能够在我们的媒体查询中使用@ screen-sm,@ screen-md和@ screen-lg名称吗?因为它不适合我。我必须使用像素测量,如@media(min-width:768px){…},然后才能工作。我做错了什么?

此外,对于额外的小设备的打字错误的参考480px?不应该说高达767px?

解决方法

@nickforthought给出Bootstrap 3的最佳摘要,我们可以申请无Bootstrap我总是使用他的参考在我的工作中实现。

Bootstrap 3媒体查询

/*==========  Mobile First Method  ==========*/

/* Custom,iPhone Retina */ 
@media only screen and (min-width : 320px) {

}

/* Extra Small Devices,Phones */ 
@media only screen and (min-width : 480px) {

}

/* Small Devices,Tablets */
@media only screen and (min-width : 768px) {

}

/* Medium Devices,Desktops */
@media only screen and (min-width : 992px) {

}

/* Large Devices,Wide Screens */
@media only screen and (min-width : 1200px) {

}



/*==========  Non-Mobile First Method  ==========*/

/* Large Devices,Wide Screens */
@media only screen and (max-width : 1200px) {

}

/* Medium Devices,Desktops */
@media only screen and (max-width : 992px) {

}

/* Small Devices,Tablets */
@media only screen and (max-width : 768px) {

}

/* Extra Small Devices,Phones */ 
@media only screen and (max-width : 480px) {

}

/* Custom,iPhone Retina */ 
@media only screen and (max-width : 320px) {

}

Bootstrap 2.3.2媒体查询

@media only screen and (max-width : 1200px) {

}

@media only screen and (max-width : 979px) {

}

@media only screen and (max-width : 767px) {

}

@media only screen and (max-width : 480px) {

}

@media only screen and (max-width : 320px) {

}

资源来源:https://scotch.io/quick-tips/default-sizes-for-twitter-bootstraps-media-queries

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读