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 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

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

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.

HTML

            
              <div id="container">
<h1>CSS File Icons</h1>
<nav>
  <a href="javascript:"><span>public</span></a>
  <a href="javascript:"><span>User</span></a>
  <a href="javascript:"><span>Documents</span></a>
  <a href="javascript:"><span>Folder</span></a>
</nav>
<h2>Welcome!</h2>
<p>
  Here I have used the CSS3 attribute selector to automatically make the relevent icons appear before any links to certain filetypes I have in my page. That is, there are no classes involved, CSS3 can see what is linked to and add the relevent icon if it links to a filetype we specify - nifty hey! Check it out below, feel free to swap the extensions round in the html and see the icons magically  change!
</p>

<ul class="left">
  <li><a href="place/file.docx">Assignment 1</a></li>
  <li><a href="place/file.pttx">Presentation</a></li>
  <li><a href="place/file.pdf">Notes</a></li>
</ul>
<ul class="right">
  <li><a href="place/file.docx">Assignment 2</a></li>
  <li><a href="place/file.docx">Assignment 3</a></li>
  <li><a href="place/file.xlsx">Results</a></li>
</ul>
</div>
            
          
!

CSS

            
              a:before{
  margin: 0 10px 0 5px;
}

a[href$=".docx"]:before {
  content:url(https://img.informer.com/icons/png/16/4135/4135583.png);
}

a[href$=".pttx"]:before {
  content:url(http://icons.iconarchive.com/icons/carlosjj/microsoft-office-2013/16/PowerPoint-icon.png);
}

a[href$=".xlsx"]:before {
  content:url(http://icons.iconarchive.com/icons/carlosjj/microsoft-office-2013/16/Excel-icon.png);
}

a[href$=".pdf"]:before {
  content:url(http://www.wischenbart.com/img/pdf_icon.gif);
}

/* ------- Other styles -------- */

html{
  background-color:#eee;
}

#container{
  margin:0 auto;
  padding:2em;
  min-height:100%;
  max-width:800px;
  font-family:"Helvetica Neue", Helvetica, Arial, sans-serif, Consolas;
  font-size:14px;
  line-height:1.5em;
  color:#333;
  background-color:#fff;
  -webkit-box-shadow:0 0 12px rgba(0,0,0,0.4);
  -moz-box-shadow:0 0 12px rgba(0,0,0,0.4);
  box-shadow:0 0 12px rgba(0,0,0,0.4);
  overflow: hidden;
  border-radius: 15px;
  margin-top: 25px;
}

h1{
  font-size:30pt;
}

p{
  text-align:justify;
  text-justify:inter-word;
}

ul.left{
  list-style: none;
  width:45%;
  float: left;
}

ul.right{
  list-style: none;
  width:45%;
  float: right;
}

a{
  text-decoration:none;
  color:#111;
}

a:hover{
  text-decoration:underline;
}

nav {
  padding: 12px 0;
  border-top: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
}

nav a{
  color:#00F;
}

nav a:hover {
  text-decoration:none;
}

nav a:hover span {
  text-decoration:underline;
}

nav a:after {
  content: ">";
  padding: 0 8px;
}

nav a:last-child:after {
  content: "";
  padding: 0;
}
            
          
!

JS

            
              $('a').click(function(){return false});
            
          
!
999px

Console