8

Full Screen Vertical Scroll Snap

 2 years ago
source link: https://codepen.io/argyleink/pen/yLovWjz
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Pen Settings

HTML Preprocessor

Add Class(es) to <html>

Stuff for <head>

xxxxxxxxxx
<section>
  <h1>slide 1</h1>
</section>
<section>
  <h1>slide 2</h1>
</section>
<section>
  <h1>slide 3</h1>
</section>
<section>
  <h1>slide 4</h1>
</section>
<section>
  <h1>slide 5</h1>
</section>
html, body, section {
  block-size: 100%;
}
html {
  scroll-snap-type: y mandatory;
}
section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}
section:nth-of-type(even) {
  color: white;
  background: black;
}
section:nth-of-type(odd) {

JS (Babel)

JS (Babel)

xxxxxxxxxx
999px

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK