123

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Bootstrap 3 Container Examples and Common Misuse</h3>
<h2>View in Desktop mode</h2>

<p class="by-me">Demo by <a href="https://scotch.io">scotch.io</a></p>
<p class="row-example">Rows are orange</p>
<p class="toggle">Toggle Padding to help visualize even more <input type="checkbox"></p>


    <main>

        <section id="with-container-example">
            <h2>With Container</h2>
            <div class="container">
                <div class="row">
                    <p class="absolute-example">
                    This is positioned-absolute, relative to the row to help visualize
                    </p>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                </div>
            </div>
        </section>


        <section id="with-no-container">
            <h2>With No Container</h2>
            <div class="row">
                <p class="absolute-example">
                This is positioned-absolute, relative to the row to help visualize
                </p>
                <div class="col-xs-4">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                </div>
                <div class="col-xs-4">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                </div>
                <div class="col-xs-4">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                </div>
            </div>
        </section>

        <section id="with-container-fluid">
            <h2>With Container-Fluid</h2>
            <div class="container-fluid">
                <div class="row">
                    <p class="absolute-example">
                    This is positioned-absolute, relative to the row to help visualize
                    </p>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                    <div class="col-xs-4">
                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis est eget tristique vestibulum. Fusce et pulvinar erat, id viverra sem. Vivamus porttitor, sapien nec mattis fermentum, sem augue ornare erat, vitae interdum ante sapien id libero. Vestibulum luctus augue pretium purus posuere.
                    </div>
                </div>
            </div>
        </section>

    </main>
            
          
!
            
              /*========================================================
=            USELESS / FOR SETTING UP EXAMPLE            =
========================================================*/
body{ margin: 0; padding: 0; background: #fafafa; }
main {
  background: #e3e3e3;
  overflow: hidden;
  padding-top: 50px;
  padding-bottom: 50px;
}
main.padding {
  padding-left: 100px;
  padding-right: 100px;
}
h1 {
  text-align: center;
}
h2 {
  text-align: center;
}
p.absolute-example {
  position: absolute;
  display: block;
  left: 0;
  top: 0; 
  background: yellow;
}
section {
  padding: 30px 0;
  margin: 20px 0;
}
p.row-example { color: orange; text-align: center; }
p.toggle {
  text-align: center;
}
.by-me { text-align: center; }



/*==========================================================
=            FOR VISUALIZING THE ROW AS A BLOCK            =
==========================================================*/
.row {
  position: relative;
  padding-top: 30px;
  background: orange;
}
#with-container-example {
  background: pink;
}

#with-no-container {
  background: purple;
}
#with-container-fluid {
  background: green;
}
            
          
!
            
              $(function() {
  $('input').change(function() {
    $('main').toggleClass('padding');
  });
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console