<section>
<h1>タイトル1-1</h1>
<p>...</p>
<h1>タイトル1-2</h1>
<p>...</p>
<h1>タイトル1-3</h1>
<p>...</p>
</section>
<section>
<h1>タイトル2-1</h1>
<p>...</p>
<h1>タイトル2-2</h1>
<p>...</p>
<h1>タイトル2-3</h1>
<p>...</p>
</section>
<section>
<h1>タイトル3-1</h1>
<p>...</p>
<h1>タイトル3-2</h1>
<p>...</p>
<h1>タイトル3-3</h1>
<p>...</p>
</section>
<section>
<h1>タイトル4-1</h1>
<p>...</p>
<h1>タイトル4-2</h1>
<p>...</p>
<h1>タイトル4-3</h1>
<p>...</p>
</section>
<section>
<h1>タイトル5-1</h1>
<p>...</p>
<h1>タイトル5-2</h1>
<p>...</p>
<h1>タイトル5-3</h1>
<p>...</p>
</section>
* {
box-sizing: border-box;
}
body {
min-height: 100vh;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
h1 {
font-size: 20px;
color: #fff;
background: #333;
padding: 10px 15px;
margin: 0;
}
p {
font-size: 30px;
}
section {
width: 100%;
background: #fff;
padding: 20px;
}
section:nth-child(2) {
background: #a0dde2;
}
section:nth-child(3) {
background: #e2a0b4;
}
section:nth-child(4) {
background: #eec496;
}
section:nth-child(5) {
background: #a0e2c2;
}
h1 {
position: sticky;
top: 20px;
}
p {
margin-bottom: 50vh;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.