Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <!-- By Lorenzo Satta Chiris -->

<div class="container">
  <h1 class="title" id="title">Lorem Ipsum dolor sit amet</h1>
  <p class="text" id="text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam recusandae maxime pariatur perferendis aliquam voluptatem perspiciatis? Dicta assumenda laudantium vitae atque, dolorum excepturi illo sequi, iste ex, nulla consectetur fuga.
    Assumenda laborum voluptatem ab neque reprehenderit odit, esse exercitationem tenetur deleniti harum dignissimos similique saepe sapiente quam natus voluptate, minus omnis eaque quo perferendis fugit? Assumenda quod consequuntur fugit suscipit.
    Deleniti, blanditiis ut. Provident vitae ab dolorum nostrum. Magnam blanditiis, at aspernatur ducimus similique dolor corporis maiores ut odio magni, sint consequatur, a aliquid nobis neque fugit aut. Expedita, adipisci!
    Fugit molestiae sequi voluptatum aspernatur sit ad qui, magnam laudantium nam beatae aliquam nostrum aperiam modi pariatur ratione hic, quibusdam nesciunt fugiat, at consequuntur nobis consequatur quasi impedit! Repudiandae, fugiat.
    Ipsam quia necessitatibus a numquam cupiditate? Ab hic ratione aliquid rerum in excepturi nulla quam harum rem alias architecto maxime quae, autem perspiciatis debitis voluptatibus quaerat voluptatum, commodi labore. Beatae.</p>

  <hr>

  <h1 class="title" id="title2">Why do we use it?</h1>
  <p class="text" id="text2">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>

  <hr>

  <h1 class="title" id="title3">Where can I get some?</h1>
  <p class="text" id="text3">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>

  <span class="test" data-hover="By Lorenzo Satta Chiris">I work without javascript</span>
</div>
              
            
!

CSS

              
                /* By Lorenzo Satta Chiris */

body {
  background-color: whitesmoke;
}

.container {
  display: center;
  justify-content: center;
  text-align: center;
  align-content: center;
  border: 5px solid black;
  padding: 200px 100px;
}

.text {
  font-size: 17px;
}

@media only screen and (min-width: 600px) {
  .container {
    border-color: red;
  }
  .text {
    font-size: 18px;
  }
}

@media only screen and (min-width: 768px) {
  .container {
    border-color: blue;
  }
  .text {
    font-size: 20px;
  }
}

@media only screen and (min-width: 992px) {
  .container {
    border-color: green;
  }
  .text {
    font-size: 20px;
  }
}

@media only screen and (min-width: 1200px) {
  .container {
    border-color: violet;
  }
  .text {
    font-size: 22px;
  }
}

/* You can also have a hover effect with no Javascript */

.test:hover {
  font-size: 0;
}

.test:hover:before {
  font-size: 20px;
  content: attr(data-hover);
}

              
            
!

JS

              
                // By Lorenzo Satta Chiris

const text = document.getElementById("text");
const title = document.getElementById("title");
const text2 = document.getElementById("text2");
const title2 = document.getElementById("title2");
const text3 = document.getElementById("text3");
const title3 = document.getElementById("title3");

text.onmouseover = function () {
  text.innerHTML =
    "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.";
  title.innerHTML = "What is Lorem Ipsum?";
};

text.onmouseout = function () {
  text.innerHTML =
    "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam recusandae maxime pariatur perferendis aliquam voluptatem perspiciatis? Dicta assumenda laudantium vitae atque, dolorum excepturi illo sequi, iste ex, nulla consectetur fuga. Assumenda laborum voluptatem ab neque reprehenderit odit, esse exercitationem tenetur deleniti harum dignissimos similique saepe sapiente quam natus voluptate, minus omnis eaque quo perferendis fugit? Assumenda quod consequuntur fugit suscipit. Deleniti, blanditiis ut. Provident vitae ab dolorum nostrum. Magnam blanditiis, at aspernatur ducimus similique dolor corporis maiores ut odio magni, sint consequatur, a aliquid nobis neque fugit aut. Expedita, adipisci! Fugit molestiae sequi voluptatum aspernatur sit ad qui, magnam laudantium nam beatae aliquam nostrum aperiam modi pariatur ratione hic, quibusdam nesciunt fugiat, at consequuntur nobis consequatur quasi impedit! Repudiandae, fugiat. Ipsam quia necessitatibus a numquam cupiditate? Ab hic ratione aliquid rerum in excepturi nulla quam harum rem alias architecto maxime quae, autem perspiciatis debitis voluptatibus quaerat voluptatum, commodi labore. Beatae.";
  title.innerHTML = "Lorem Ipsum dolor sit amet";
};

text2.onmouseover = function () {
  text2.innerHTML =
    "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of de Finibus Bonorum et Malorum (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, Lorem ipsum dolor sit amet, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from de Finibus Bonorum et Malorum by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.";
  title2.innerHTML = "Where does it come from?";
};

text2.onmouseout = function () {
  text2.innerHTML =
    "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).";
  title2.innerHTML = "Why do we use it?";
};

text3.onmouseover = function () {
  text3.innerHTML = "https://www.lipsum.com/ \n";
  title3.innerHTML = "Source:";
};

text3.onmouseout = function () {
  setTimeout(function () {
    // When first text (in this case source text) is very less long that new text you have to set a timout function to handle infinite text changing bug --> try removing set timeout and hover last paragraph
    text3.innerHTML =
      "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.";
    title3.innerHTML = "Where can I get some?";
  }, 500); // Wait for 1/2 second
};

              
            
!
999px

Console