【发布时间】:2021-05-04 15:23:59
【问题描述】:
我在 next js 中有一个应用程序,它也使用脉轮 UI。我正在尝试向应用程序添加页脚,但无法强制导航栏下的组件占据屏幕的剩余高度。
我认为我的问题是我没有正确地将 CSS 样式传递给组件。
_app.tsx
import '../styles/globals.css';
function MyApp({ Component, pageProps }) {
return (
<ChakraProvider theme={theme}>
<Navbar></Navbar>
<Component id='component-container' {...pageProps} />
)
}
export default MyApp
styles/globals.css
#component-container {
height: 100%
}
即使我将#component-container 设置为color: white 之类的东西,我也没有看到此CSS 应用于子组件。我认为我没有正确地将 CSS 传递给组件。
如何正确地将 CSS 应用到 next js 中的所有组件?
【问题讨论】:
标签: css reactjs next.js chakra-ui