如何定位 Next.js 中的活动链接 (next 13)
const Sidebar = () => {
const link = [
{
label: ' Home',
path: '/',
},
{
label: ' About',
path: '/about',
}
]
return (
<div>
{sidebarLink.map((link, index) =>
<Link
key={link.index}
href={link.path}>
</Link>
)}
</div>
)
}
export default Sidebar
Run Code Online (Sandbox Code Playgroud)
我尝试了一切都无济于事
我有三个项目(列)并display: flex设置margin-left为它们。当我调整窗口大小并向右滚动时,它们将超出框/窗口(溢出)。第二个问题-第三张图片的高度不同,即使我设置max-height了它。这只是代码的一部分(即使在这里问题也会再次出现):
body {
margin: 0;
width: 100%;
}
.background {
position: relative;
width: 100%;
height: 1000px;
background-color: gray;
}
.articleContainer {
position: relative;
display: flex;
width: 100%;
height: 600px;
}
.content {
position: relative;
display: flex;
margin-left: 10%;
border-top: 7px solid rgb(227, 0, 26);
height: 600px;
background-color: black;
top: -4px;
width: 333px;
}
.content img {
top: 0;
max-height: 230px;
width: 333px;
}
.box {
position: absolute;
width: 60px;
height: 60px;
top: 0; …Run Code Online (Sandbox Code Playgroud)