<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<header>Header Content</header>
<div class="page-wrapper">
<sidebar>Sidebar Content</sidebar>
<main>
<div class="overflow-div">
<div class="overflow-content"></div>
</div>
</main>
</div>
<footer>Footer Content</footer>
</body>
</html>
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
* {
box-sizing: border-box;
}
header, footer {
background: #e2e2e2e2;
text-align: center;
padding: 10px;
}
.page-wrapper {
flex-grow: 1;
display: flex;
}
sidebar {
width: 300px;
padding: 20px;
background-color: #e2e2e2;
flex-shrink: 0;
}
main {
flex-grow: 1;
/*width: calc( 100% - 300px); - Так работает, но не подходит*/
padding: 20px;
min-width: 0;
}
.overflow-div {
max-width: 100%;
width: 100%;
overflow-x: hidden;
}
.overflow-content {
width: 5000px;
background-color: red;
padding: 20px;
color: white;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.