Я пытаюсь создать элемент div, который прокручивается и содержится в элементе flex, развернутом для заполнения страницы.
В моем коде column2 будет иметь длинное содержимое, поэтому нам нужны отдельные прокруткидля каждого столбца.
Это моя текущая структура:
html,
body {
margin: 0;
padding: 0;
border: 0;
height: 100%;
min-height: 100%;
}
BODY.screen-layout-body {
overflow: hidden;
}
.flex.two-col-main-sidebar {
display: flex;
flex-direction: row;
width: 100%;
padding-right: 0;
}
.flex.layout-content-default {
width: 100.0%;
min-width: 0;
max-width: none;
display: flex;
flex-flow: column wrap;
}
.layout-content-default {
width: 100.0%;
min-width: 0;
max-width: none;
display: block;
}
.content {
white-space: normal;
}
.content-item {
vertical-align: top;
display: block;
margin: 0.0px 0 14.0px 0px;
width: 100.0%;
padding: 0 0.0px 0 0.0px;
}
.two-col-main-sidebar>.column-1 {
margin: 0;
float: left;
width: 100%;
box-sizing: border-box;
position: relative;
display: block;
padding-right: 0.0px;
}
.flex.two-col-main-sidebar>.column-1 {
margin: 0;
padding-left: 0;
position: static;
float: none;
padding-right: 0.0px;
flex: 1 1 0%;
}
.two-col-main-sidebar>.column-2 {
margin: 0 -100% 0 0;
float: left;
box-sizing: border-box;
position: relative;
display: block;
width: 300.0px;
}
.flex.two-col-main-sidebar>.column-2 {
margin: 0;
position: static;
float: none;
flex: 0 0 300.0px;
}
<html>
<body class="screen-layout-body with-fixed-header">
<div class="header">Header</div>
<div class=" flex content layout-content-default two-col-main-sidebar">
<div class="content-item content-layout column-1">Column1 which will be 70% of screen. I need to add scroll bar to this div which will overflow content</div>
<div class="content-item content-layout column-2">Column2 which will be 30% of screen</div>
</div>
</body>
<html>
Примечание: Что бы ни находились здесь классы CSS, созданные инструментом, мы не можем их изменить, кроме того, мы можем добавить больше классов к любомуdiv, чтобы заставить его работать.