我正在开发一个 Angular 5 应用程序,它需要是一个响应式应用程序。
我面临着使其响应的问题1366X768
and 1920X1080
字体大小不同的分辨率。
问题一:我在 style.scss 中覆盖了断点,如下所示:
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl:1900px //this is custom breakpoint; after compiling bootstrap does generates col-xxl-* classes
);
I have added xxl
as new breakpoint. Now when I add col-xxl-*
class to any of my element, that element takes full width jusy like what col-12
does.
Refer image below :
![enter image description here](https://i.stack.imgur.com/E8ZSo.png)
对于有红色边框的容器,我给出了col-xxl-3
班级;但它仍然具有全宽。为什么它与响应式网格类相关col-*-3
没有得到应用。
我认为它应该生成如下所示的CSS:
.col-xxl-3 {
-webkit-box-flex: 0;
-ms-flex: 0 0 25%;
flex: 0 0 25%;
max-width: 25%;
}
但事实并非如此。难道我做错了什么 ?
问题2
由此引导响应断点 https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints,我们可以使用 mixin 来针对不同的分辨率。因此,在组件级别的 scss 中,我使用了这些 mixin,如下所示:
@import '~bootstrap/scss/_functions.scss';
@import '~bootstrap/scss/_variables.scss';
@import '~bootstrap/scss/_mixins.scss';
span.work_catalog {
@include media-breakpoint-up(xl) { //this will target all above 1200 px as per bootstrap documentation; so this works as u see red border in above image
border:1px solid red;
}
}
但是当我像下面这样使用它时:
span.work_catalog {
@include media-breakpoint-up(xxl) {
border:1px solid red;
}
}
这仍然适用于分辨率超过 1200px 的情况;
我假设上面的 css 应该只应用于 1900px 以上,因为我在 style.scss 中添加了自定义网格断点。
我在这里错过了什么吗?