gpt4 book ai didi

css - Angular w/Flexbox app-root 不是 100% 宽

转载 作者:行者123 更新时间:2023-11-28 00:49:29 25 4
gpt4 key购买 nike

我正在尝试使用带有 Flexbox 的 Angular 7。

准确地说是 bool 玛。

我的 app-root 组件不是 100% 宽。我怎样才能正确地实现这一目标?

我的 styles.scss 看起来像

@import "./variables";
@import "~bulma";
html,
body {
height: 100%;
}

body {
display: flex;
}

app-root {
height: 100%;
width: 100%;
}

这可行,但是我不确定以这种方式使用 app-root 是否正确。

最佳答案

你有app.component.scss文件吗?

您可以添加它,它应该正确定位该组件。

:host {
width: 100%;
height: 100%;
}

:host 用于定位托管元素(例如 )。

关于css - Angular w/Flexbox app-root 不是 100% 宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53333896/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com