Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>Ver consola</h1>
<section id="s1">
  <h1>Seccion s1</h1>
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Ea, aut nemo voluptate suscipit hic numquam tenetur eos id repellat, doloribus repellendus nostrum esse rem quos veritatis similique dolorum incidunt quas?
<section id="s2">
  <h1>Seccion s2</h1>
  Lorem ipsum dolor, sit amet consectetur adipisicing elit. Obcaecati odit laboriosam praesentium, placeat rerum sunt. Amet odit doloremque at quasi veniam, possimus excepturi eaque natus mollitia quisquam. Sint, et numquam.
<section id="s3">
  <h1>Seccion s3</h1>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Obcaecati dolor magnam fuga, accusamus quis, repudiandae iste sint, odit culpa praesentium deleniti in totam harum voluptatem reiciendis voluptatibus excepturi facilis quidem.
<section id="s4">
  <h1>Seccion s4</h1>
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor reprehenderit enim hic sint iste quis, vero consequuntur vel, rerum dicta delectus veniam explicabo dolorem ad, perspiciatis, expedita blanditiis labore eaque.
<section id="s5">
  <h1>Seccion s5</h1>
  Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quisquam nesciunt enim, dolorum sint nostrum mollitia iste, tempora a aut praesentium labore recusandae atque ducimus voluptates! Iste, architecto necessitatibus amet eveniet.


                * {
  font-family: monospace;
section {
  height: 100vh;



                let secciones = document.querySelectorAll("section");
let quiebres = [];

for (let sec of secciones) {
  var topSeccion = sec.offsetTop;
  var idSeccion =;
  var breakpoints = [topSeccion, idSeccion];


addEventListener("scroll", function (e) {
  //let actual = window.pageYOffset
  let actual = window.scrollY + window.innerHeight;

  // Me devuelve el ID de la seccion actual
  if ((actual > quiebres[0][0]) & (actual < quiebres[1][0])) {
  } else if ((actual > quiebres[1][0]) & (actual < quiebres[2][0])) {
  } else if ((actual > quiebres[2][0]) & (actual < quiebres[3][0])) {
  } else if ((actual > quiebres[3][0]) & (actual < quiebres[4][0])) {
  } else if (actual > quiebres[4][0]) {