所以我的问题是,当我编写 CSS 时,您可以使用 @media 然后输入最大和最小宽度,如下所示:
@media (min-width: 0px) and (max-width: 767px) {
#social-icons {
padding-left: 125px;
}
}
但我想知道您是否可以这样做但不是使用像素而是使用 Bootstrap 列方法,所以它就像 (min-width: col-md-3) 或类似的东西,这可能吗?
最佳答案
是的,你可以!所以根据 bootstrap 网站,您可以在网格系统中使用媒体查询!
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) { ... }
/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) { ... }
/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) { ... }
@media (max-width: @screen-xs-max) { ... }
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { ... }
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) { ... }
@media (min-width: @screen-lg-min) { ... }
这是来自 bootstraps 网站 CSS 页面的所有代码,here.
关于html - 写 CSS 媒体内容时可以使用 Bootstraps 列吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34241238/