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

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

相关文章

Bootstrip HTML 查询搜索常用格式模版 <form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...