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 BootstrapSmall 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?
解决方法
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。