admin管理员组文章数量:1316356
import React from "react";
import "./clientLayout.css";
const ClientLayout = () => {
const generateParagraphs = (count) => {
return Array.from({ length: count }, (_, index) => <p key={index}>Paragraph {index + 1}</p>);
};
return (
<div className="client-layout-container">
<div className="sidebar">{generateParagraphs(1000)}</div>
<div className="content">{generateParagraphs(1000)}</div>
</div>
);
};
export default ClientLayout;
This is what I have to test scrolling. Now sidebar actually doesnt need scrolling. Its content that need scrolling.
.client-layout-container {
width: 100%;
height: 100dvh;
position: relative;
display: grid;
grid-template-columns: 15rem 1fr;
gap: 0.2rem;
overflow: hidden;
}
.sidebar {
background: green;
height: 100%;
overflow: auto;
}
.content {
background: yellow;
min-height: 100%;
overflow: auto;
}
Now when sidebar get overflow:auto, then they both scroll independently. But I dont want that overflow: auto in sidebar. I dont want to specify anything about overflow. And so if I remove it. content looses its scroll ability.
本文标签: cssHow do make scrolling work I can39t make independent scrollingsStack Overflow
版权声明:本文标题:css - How do make scrolling work? I can't make independent scrollings - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741999857a2410788.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论