cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <ol class="breadcrumb" doc-info>
  <li><a href="#">Home</a></li>
  <li><a href="#">Library</a></li>
  <li class="active">Data</li>
</ol>

<hr />

<nav doc-info>
  <ul class="pagination">
    <li>
      <a href="#" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
    <li><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li><a href="#">3</a></li>
    <li><a href="#">4</a></li>
    <li><a href="#">5</a></li>
    <li>
      <a href="#" aria-label="Next">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>

<hr />

<nav class="navbar navbar-default" doc-info>
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>
      <form class="navbar-form navbar-left" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

<hr>

<div class="media" doc-info>
  <div class="media-left">
    <a href="#">
      <img class="media-object" src="http://placehold.it/150x150" alt="Alt Text Here">
    </a>
  </div>
  <div class="media-body">
    <h4 class="media-heading">Media heading</h4>
    Description here
  </div>
</div>

<hr>

<div class="btn-group" doc-info>
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Action <span class="caret"></span>
  </button>
  <ul class="dropdown-menu">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="#">Separated link</a></li>
  </ul>
</div>

<hr>

<ul class="nav nav-tabs" doc-info>
  <li role="presentation" class="active"><a href="#">Home</a></li>
  <li role="presentation"><a href="#">Profile</a></li>
  <li role="presentation"><a href="#">Messages</a></li>
</ul>
            
          
!
            
              @import "bourbon";

body {
   width: 90%;
   margin: 3em auto;
}

// For showing the source code for every element
.doc-wrapper {
	position: relative;
   
   -webkit-transition: .5s;
   -o-transition: .5s;
   -moz-transition: .5s;
   transition: .5s;

	.doc-button {
		display: block;
      width: 13em;
		padding: .5em 1em;
      cursor: pointer;
		
      @include margin(1em null null auto);
      
      background-color: rgba(200,200,200,.5);
		border-bottom-left-radius: .5em;
	}

	pre {
		padding: 1em 1em 2.5em;
		background-color: #ccc;
		margin: 1em 0;
	}
}
            
          
!
            
              $('*[doc-info]').each(function(){
	$(this).wrap('<div class="doc-container"></div>');
	$(this).closest('.doc-container').wrap('<div class="doc-wrapper"></div>');
   $(this).removeAttr('doc-info');

	var container = $(this).closest('.doc-container'),
		wrapper = $(this).closest('.doc-wrapper');

	//create button after div
	$("<div class='doc-button'>< /> Click to Show Code</div>").insertAfter(container);
	//create pre wrapper after button

	var button = container.next('.doc-button')
	$("<pre></pre>").insertAfter(button);
	//hide the pre so can slidetoggle later
	$("pre").hide();

	button.one("click", function() {

	  var cloned = $(this).prev('.doc-container').clone(),
	    code = $(cloned).html().split("\n").filter(function(n) {
	      return (n.replace(/\s+$/, '') != '');
	    }),
	    spacesOnLeft = code[0].match(/^ */)[0].length;

	  for (var i = 0, len = code.length; i < len; i++) {
	      var output = button.next('pre'),
	          existing_text=output.text(),
	          new_text=code[i].substring(spacesOnLeft);
	      output.text(existing_text + new_text + '\n');
	  }
	});
});

$(".doc-button").click(function() {
	$(this).next().slideToggle("fast", function() {});
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console