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 is required to process package imports. If you need a different preprocessor remove all packages first.

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


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>Bali Sprites - Responsive</h1>
<h2>Hover over the Images</h2>
<div class="container clearfix">
  <div class="rsprite"></div>
  <div class="rsprite rsprite2"></div>
  <div class="rsprite rsprite3"></div>
<h2>Six Different Images<br>Displayed From One Loaded Image File<br>AKA Sprite</h2>
<div class="para-one-third">
  <p>The total of <strong>six</strong> images above come from one image file that is <strong>loaded only once</strong>. Without CSS sprites (which is the typical scenario) this example page would ask the browser to fetch six separate images instead of one.
    Creating six <mark><em>expensive</em></mark> server round trips.</p>
  <p>Loading only one image file to display <em>multiple</em> images is the main advantage of using <a target="_blank" rel="nofollow" href="">CSS sprites</a>. If webpage performance is a priority for you, you should consider
    using CSS sprites. Plus, <strong>Google PageSpeed</strong> loves them .</p>


                body {
  text-align: center;
  padding: 20px;
  font: 1em Helvetica Neue Light, Helvetica, Arial, sans-serif;

* {
  box-sizing: border-box;

p {
  margin: 0 0 1em 0;

h2 {
  font-weight: 100;
  line-height: 2.25rem;

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3%;

/* Fallback if no flexbox support. */
.clearfix:after {
  content: "";
  display: table;
  clear: both;

.para-one-third {
  text-align: left;
  padding-left: 10%;
  padding-right: 10%;

@media screen and (min-width: 768px) {
  .para-one-third {
    padding-left: 33.333%;
    padding-right: 33.333%;

/* End formatting. 
   Begin sprite CSS. */

div.rsprite {
  float: left; /* If no flexbox. */
  width: 20%;
  height: 0;
  padding-bottom: 30%;
  margin-left: 1%;
  background-image: url("");
  background-position: 0 0;
  background-size: 600%;
  display: block;
div.rsprite:hover {
  background-position: 20% 0; /* Use ONLY percents here */
div.rsprite2 {
  background-position: 40% 0;
div.rsprite2:hover {
  background-position: 100% 0;
div.rsprite3 {
  background-position: 60% 0;
div.rsprite3:hover {
  background-position: 80% 0;