gpt4 book ai didi

reactjs - Next.js:如何更改特定页面上根 div __next 的 css?

转载 作者:行者123 更新时间:2023-12-03 14:07:32 24 4
gpt4 key购买 nike

我想在登录页面更改 id 为 __next 的 div。但是当我在 jsx 中添加样式时,当 dom 挂载到页面时,它似乎更改为 id #__next.jsx-2357705899, .main.jsx-2357705899 的另一个 div。

当登录页面挂载时,如何更改 __next div 的 css?

<style jsx>{`
#__next,
.main {
height: 100%;
}
`}</style>

最佳答案

也许这对某人有帮助。
创建文件夹“styles”添加“globals.css”

将其添加到该文件

@tailwind components;
@tailwind utilities;
@layer components {
#__next {
@apply h-full bg-red-500;
}
html,
body {
@apply h-full;
}
}

转到您的 _app.js 并导入上面的样式表。

关于reactjs - Next.js:如何更改特定页面上根 div __next 的 css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51905803/

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