CSS空白格式父元素,换行子元素



我正在做一些数字教案,我需要一些帮助。我试图使每个<section>坐在彼此旁边的内联块样式。因为每个部分都是500px宽,所以任何不适合视窗的额外部分都应该能够水平滚动。

我需要什么:基本上,除了5个section元素之外,页面上的所有内容都应该保持固定位置,并且部分的内部可能比可见的高。我希望教师能够水平滚动以查看一周中超出监视器视口范围的天数。

How I tried fix:每当我使用white-space: nowrap属性时,我都能够让各节坐在水平滚动旁边,然而,这会导致部分内部的文本离开该部分,这是不可取的。文本应该包含在500px宽度内,我只需要这些部分在一行中彼此相邻。

如果我应该采取另一种方法,我愿意改变CSS格式。我还在学习,所以任何解释都会非常有帮助,这样我才能学习和成长。

裸贴:https://pastebin.com/xX8LjyNq

body {margin: 0;}
.centered {
display: flex;
justify-content: center;
align-items: center;}
nav {
z-index: 3;
position: fixed;
top: 0; left: 0;
width: 100%; height: 65px;
border-bottom: 1px solid lightgray}
#title {
z-index: 2;
position: fixed;
top: 65px; left: 0;
width: 100%; height: 80px;
font-size: 36px;
color: #484848;
background-color: white;
border-bottom: 1px solid lightgray}

/* --------[LESSON PLAN]-------- */
#lessonPlan {
position: absolute;
top: 146px; left: 0;
max-width: 2600px;
overflow-x: scroll;}
#lessonPlan section {
width: 500px;
min-height: calc(100vh - 205px);
margin: 0;
padding: 16px;
box-sizing: border-box;
border-right: 1px solid lightgray}
.weekday {
width: 100%;
margin-bottom: 30px;
font-weight: 800;
font-size: 26px;
color: #484848;
text-align: center;}
.alignment .title, .objective .title, .materials .title, .assignments .title{
color: #484848;
font-weight: 400;
text-decoration: underline;}
#container ul {
padding: 0px 30px;
list-style: none;}
#container li {
padding: 10px 8px;
margin-bottom: 6px;
border: 1px solid white}
#container li:hover {
border-radius: 20px;
border: 1px solid lightgray;}
#container li a {
font-weight: 800;
text-decoration: none;}
/* --------[BOTTOMBAR]-------- */
#bottombar {
position: fixed;
bottom: 0px; left: 0;
width: 100%; height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
width: 100vw;
padding: 0px 10px;
box-sizing: content-box;
border-top: 1px solid lightgray}
#bottombar .controls span {
margin-right: 10px;
color: #484848;}
#bottombar select{
appearance: none;
-webkit-appearance: none;
padding: 8px 16px;
font-size: 18px;
border-radius: 12px;
border: 1px solid gray}
#bottombar input {
padding: 6px 16px;
font-size: 18px;
border-radius: 12px;
border: 1px solid gray}
#bottombar .button { /* <- Customizes the global button design */
padding: 8px 24px;
margin-right: 20px;
font-size: 18px;
border-radius: 26px}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../resources/style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Indie+Flower">
<title>5th Grade Team | Weekly Lesson Plans</title>
</head>
<body>
<nav></nav>
<div id='title' class='centered'> <span>Week 2</span> </div>
<div id='lessonPlan'>
<div id='container'>
<section>
<div class='weekday'>Mon, Aug 23rd</div>
<div class='alignment'>
<span class='title'>Standards:</span>
<ul><li class='standard'><span class='oas'>(1.R.3)</span> I can work with others to discuss topics and texts.</li>
</ul>
</div>
<div class='objective'>
<span class='title'>Objective:</span>
<ul><li>1. Students will complete the Buckle Down assessment. </li><li>2. Students will learn about agricultural practices. </li>
</ul>
</div>
<div class='materials'>
<span class='title'>Materials:</span>
<ul><li>Complete Buckle Down Assessment</li><li>Plant Tobacco </li>
</ul>
</div>
</section><section>
<div class='weekday'>Tue, Aug 24th</div>
<div class='alignment'>
<span class='title'>Standards:</span>
<ul><li class='standard'><span class='oas'>(SS.1.1)</span> I can summarize the reasons settlers came to the Americas.</li>
</ul>
</div>
<div class='objective'>
<span class='title'>Objective:</span>
<ul><li>1. Students will look through the Jamestown Fort Project and begin to make a plan.</li>
</ul>
</div>
<div class='materials'>
<span class='title'>Materials:</span>
<ul><li><a target='_blank' href='https://drive.google.com/file/d/1gv-uFx_H7GoE86GQ2KQrcuv0FOIJNNNk/view?usp=sharing'>📎 Susan Constant</a></li><li><a target='_blank' href='https://drive.google.com/file/d/1MuXSxHtJgOhFM4bb6QT3cfArcH5Uae4s/view?usp=sharing'>📎 Jamestown Anticipation</a></li>
</ul>
</div>
</section><section>
<div class='weekday'>Wed, Aug 25th</div>
<div class='alignment'>
<span class='title'>Standards:</span>
<ul><li class='standard'><span class='oas'>(SS.1.2)</span> I can explain the economic/political reasons for establishing Jamestown.</li><li class='standard'><span class='oas'>(6.R.1)</span> I can create research questions to find information.</li>
</ul>
</div>
<div class='objective'>
<span class='title'>Objective:</span>
<ul><li>1. Students will examine primary sources and draw conclusions from what they find. </li>
</ul>
</div>
<div class='materials'>
<span class='title'>Materials:</span>
<ul><li><a target='_blank' href='https://www.nps.gov/jame/learn/historyculture/the-first-residents-of-jamestown.htm'>📎 Jamestown Residents </a></li><li>Gentlemen POV Writing Activity</li><li><a target='_blank' href='https://youtu.be/y6AZac_u8Sk?t=89'>📎 Virginia Colony Pt. 1</a></li>
</ul>
</div>
</section><section>
<div class='weekday'>Thu, Aug 26th</div>
<div class='alignment'>
<span class='title'>Standards:</span>
<ul><li class='standard'><span class='oas'>(SS.1.4)</span> I can explain the successes and challenges that happened at Jamestown. </li><li class='standard'><span class='oas'>(2.R.2)</span> I can determine the genre of what I am reading. </li>
</ul>
</div>
<div class='objective'>
<span class='title'>Objective:</span>
<ul><li>1. Students will identify elements of a biography. </li>
</ul>
</div>
<div class='materials'>
<span class='title'>Materials:</span>
<ul><li><a target='_blank' href='https://drive.google.com/file/d/1dAYXTwYR9RtPpBbKx9kV-1w9br_L5Dae/view?usp=sharing'>📎 Biography of John Smith</a></li><li><a target='_blank' href='https://youtu.be/y6AZac_u8Sk?t=237'>📎 Virginia Colony Pt. 2</a></li>
</ul>
</div>
</section><section>
<div class='weekday'>Fri, Aug 27th</div>
<div class='alignment'>
<span class='title'>Standards:</span>
<ul><li class='standard'><span class='oas'>(SS.1.1)</span> I can summarize the reasons settlers came to the Americas.</li><li class='standard'><span class='oas'>(2.R.1)</span> I can summarize what I have read.</li>
</ul>
</div>
<div class='objective'>
<span class='title'>Objective:</span>
<ul><li>1. Students can summarize information from a text on their own.</li>
</ul>
</div>
<div class='materials'>
<span class='title'>Materials:</span>
<ul><li>Powhatan Trade Sort</li>
</ul>
</div>
</section>      </div>
</div>
<form id='bottombar' method='get'>
<div class='controls'>
<span>Teacher:</span>
<select name='utid'>

<option value='1' >Mr. Teacher</option>
<option value='2'  disabled>Mrs. Teacher</option>
<option value='3'  disabled>Mrs. Teacher</option>
<option value='4'  disabled>Ms. Teacher</option>
</select>
<select name='week'>
<option value='2' >Week 2</option><option value='1' selected>Week 1</option><option value='0' >Week 0</option>        </select>
<button class='button purple-btn'>Go</button>
</div>
<button class='button purple-btn' type='button' onclick='location.href="csv.php?utid=1&week=2";'>Download</button>
</form>
</body>
</html>

#container {
display: flex;
flex-direction: row;}

添加到你的样式中。

最新更新