Sass 如何使用溢出滚动来固定div中的高度
我无法使用滚动应用固定高度。当我把固定高度的容器吹到所有div的高度时。我怎样才能固定高度潜水器?修复了容器中的树项目。我制作了固定容器高度“200px”,但它不起作用。也许有些事情很简单,但我看不见 以下是我的简单代码:Sass 如何使用溢出滚动来固定div中的高度,sass,flexbox,overflow,Sass,Flexbox,Overflow,我无法使用滚动应用固定高度。当我把固定高度的容器吹到所有div的高度时。我怎样才能固定高度潜水器?修复了容器中的树项目。我制作了固定容器高度“200px”,但它不起作用。也许有些事情很简单,但我看不见 以下是我的简单代码: 巴伊尔克 我的SCS: .container-Atanan{ 盒影:0px 3px 1px-2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12); 显示器
巴伊尔克
我的SCS:
.container-Atanan{
盒影:0px 3px 1px-2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);
显示器:flex;
弯曲方向:立柱;
框大小:边框框;
//背景色:#7AD3B1;
宽度:470px;
身高:80%;
溢出:自动;
填充底部:30px;
字体系列:“Roboto”,无衬线;
&-标题{
显示:内联flex;
背景色:#E2;
高度:50px;
对齐项目:居中;
&-头衔{
填充:15px;
}
}
&-列表项{
显示:内联flex;
.listItem{
显示:内联flex;
宽度:100%;
高度:72px;
文字装饰:无;
颜色:黑色;
填充:15px 15px;
}
&-化身{
右边距:10px;
显示:内联flex;
对齐项目:居中;
img{
边界半径:50%;
宽度:40px;
高度:自动;
}
}
&-内容{
显示:内联flex;
右侧填充:30px;
弯曲方向:立柱;
证明内容:中心;
左侧填充:10px;
宽度:362px;
高度:72px;
盒子阴影:0 8px 6px-20px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12);
过渡:背景色0.5s缓变;
.内容标题{
字号:500;
}
.内容字幕{
字体大小:300;
显示:内联flex;
弯曲方向:立柱;
.斜体{
字体重量:较轻;
字体:斜体;
字号:1em;
}
oldline先生{
文字装饰:线条贯通;
}
}
&:悬停{
背景:rgba(0,0,0,0.05)
}
}
}
.分隔器{
显示:块;
左边距:72px;
边框:实心;
边框宽度:薄0;
左边距:0;
右边距:0;
页边距底部:0;
&-轻的{
边框颜色:rgba(0,0,0,0.12);
}
}
}
而我的则改用这个
display:grid;
grid-template-columns :max-content max-content;
在&-header
中,从&-ListItem
中删除内联flex
,您可以将中的高度设置为所需的任何值
body{
background-color:#FEFCFC;
}
.container-Atanan {
box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
display: flex;
flex-direction: column;
box-sizing: border-box;
// background-color : #7AD3B1;
width: 470px;
height:350px;
overflow: auto;
padding-bottom : 30px;
font-family: 'Roboto', sans-serif;
&-Header {
display:grid;
grid-template-columns :max-content max-content;
background-color: #e2e2e2;
height: 50px;
align-items: center;
&-Title{
padding:15px;
}
}
&-ListItem{
.listItem{
display: inline-flex;
width: 100%;
height: 72px;
text-decoration: none;
color:black;
padding: 15px 15px;
}
&-Avatar {
margin-right: 10px;
display: inline-flex;
align-items: center;
img{
border-radius: 50%;
width: 40px;
height: auto;
}
}
&-Content {
display: inline-flex;
padding-right: 30px;
flex-direction: column;
justify-content: center;
padding-left:10px;
width: 362px;
height: 72px;
box-shadow: 0 8px 6px -20px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
transition: background-color 0.5s ease-out;
.Content-Title{
font-weight: 500;
}
.Content-Subtitle {
font-weight: 300;
display: inline-flex;
flex-direction: column;
.italic{
font-weight : lighter;
font-style: italic;
font-size :1em;
}
.oldline{
text-decoration:line-through;
}
}
&:hover{
background: rgba(0,0,0,0.05)
}
}
}
.divider{
display: block;
margin-left: 72px;
border: solid;
border-width: thin 0 0 0;
margin-left: 0;
margin-right: 0;
margin-bottom : 0;
&-Light{
border-color: rgba(0,0,0,0.12);
}
}
}
很乐意帮忙!