Bootstrap响应式设计,就是一个典型的媒体查询CSS框架,它设定了某些媒体查询节点,根据不同设备宽度,写不同的断点位置来做响应式查询。
Bootstrap推荐的媒体查询样式如下:
- /*==================================================
- = Bootstrap 3 Media Queries =
- ==================================================*/
- /*========== 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) {
评论