我已创建html独立滚动面板与个别列的固定标题&页脚3列。独立滚动3列与单独的列标题
我附上了线框供您参考。
问题1:我的代码中是否有问题? Q2:在响应式设计过程中是否会出现问题?
html, body {
height: 99%;
box-sizing: border-box;
overflow: hidden;
margin: 0px;
}
.container {
max-height: 100%;
overflow: auto;
margin-top: 100px;
}
.col-1{
float: left;
width: 20%;
position: relative;
height: calc(100vh - 140px);
}
.col-2{
float: left;
width: 20%;
position: relative;
height: calc(100vh - 140px)
}
.col-3{
float: left;
width: 60%;
position: relative;
height: calc(100vh - 140px)
}
.header, .footer,.header2, .footer2 ,.header3, .footer3 {
height: 40px;
position: fixed;
margin-top: 60px;
}
.header {
top: 0;
left: 20%;
width:20%;
background-color: #dddddd;
}
.footer {
bottom: 0;
left: 20%;
width:20%;
background-color: #dddddd;
}
.header2 {
top: 0;
left: 0%;
width:20% ;
background-color: #eeeeee;
}
.footer2 {
bottom: 0;
left: 0;
width:20% ;
background-color: #eeeeee;
}
.header3 {
top: 0;
left: 40%;
width:60% ;
background-color: #cccccc;
}
.footer3 {
bottom: 0;
left: 40%;
width:60% ;
background-color: #cccccc;
}
header{ position: fixed; width: 100%; height: 60px; background: #666666 }
ul{ list-style: none; padding:0px; }
ul li { list-style-type: none; display: block; padding:20px 10px; margin:0px; border-bottom: 1px solid #dddddd }
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<header>Header</header>
<div class="container col-1">
<div class="header">
Fixed Header
</div>
<ul>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
</ul>
<div class="footer">
Fixed footer
</div>
</div>
<div class="container col-2">
<div class="header2">
Fixed Header
</div>
<div class="content">
<ul>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
<li>Listing</li>
</ul>
</div>
<div class="footer2">
Fixed footer
</div>
</div>
<div class="container col-3">
<div class="header3">
Fixed Header
</div>
<div class="content">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div class="footer3">
Fixed footer
</div>
</div>
</body>
</html>
的骨架你想这些元素来保持固定在这些位置有一个滚动条? – divine
,我想要咖啡。你有什么努力去实现这一目标?你的代码在哪里? –
是的!我希望这些元素保持固定在滚动条的这些位置,我应该稍后作出响应 – Subh