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.

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

              
                <div class="main"> 
  <div class="header">
    <div class="path">
      <p>Articles</p>
      <p id="articleHeaderName">Create New Article</p>
    </div>
    <div class="logo"></div>
  </div>
  <div class="sidebar">
    <div class="circles"></div>
    <div class="exitMenu">
      <input type="checkbox" id="exitMenuCheckbox"/> 
      <label for="exitMenuCheckbox"></label>
      <div class="finishButton">
        <a href="javascript:void(0);" id="publish">Publish</a>
        <a href="javascript:void(0);" id="save">Save Draft</a>
        <a href="javascript:void(0);" id="delete">Delete Draft</a>
      </div>
    </div>
  </div>
  <div class="content">
    <h1 contenteditable="true">Simple blog editor - A great way of learning</h1>
    <div class="textEditing">
      
      <input type="checkbox" id="bold"><label for="bold"><span class="fontawesome-bold"></span></label></input>
      <input type="checkbox" id="italic"><label for="italic"><span class="fontawesome-italic"></span></label></input>
      <input type="checkbox" id="underline"><label for="underline"><span class="fontawesome-underline"></span></label></input>
      <input type="radio" name="textStyle" id="left" checked><label for="left"><span class="fontawesome-align-left"></span></label></input>
	    <input type="radio" name="textStyle" id="center"><label for="center"><span class="fontawesome-align-center"></span></label></input>
      <input type="radio" name="textStyle" id="right"><label for="right"><span class="fontawesome-align-right"></span></label></input>
      <input type="radio" name="textStyle" id="justify"><label for="justify"><span class="fontawesome-align-justify"></span></label></input>
      <input type="file" id="image"><label for="image"><span class="fontawesome-picture"></span></label></input>
      <input type="checkbox" id="attachment"><label for="attachment"><span class="fontawesome-link"></span></label></input>
      <input type="" id="link"><label for="link" id="linkLable"><span id=""></span></label></input>
      <input type="checkbox" id="code"><label for="code"><span class="fontawesome-quote-right"></span></label></input>
    </div>
  <p id="contentText" contenteditable="true">Enter text here</p>
  </div>
</div>
              
            
!

CSS

              
                @import url(http://weloveiconfonts.com/api/?family=fontawesome);

/* fontawesome */
[class*="fontawesome-"]:before {
  font-family: 'FontAwesome', sans-serif;
  font-size:21px;
  position: absolute;
  margin-top: 15px;
  margin-left: 24px;
}

body{
  margin:0px;
  font-family: Arial, Helvetica, sans-serif;
  background:#E5EBEF;
}

div .header{
  background:rgba(57, 89, 123, 0.8);
  width:100%;
  height:80px;
  position:fixed;
  z-index:1;
  padding-left:160px;
}

div .sidebar .circles{
  border-style:solid;
  border-color:white;
  border-radius:50%;
  border-width:5px;
  width:10px;
  height:10px;
  margin-top:30px;
  margin-left:15px;
  float:left;
  
  box-shadow: 16px 0px 0px -5px #29343A,
              16px 0px 0px 0px white,
              32px 0px 0px -5px #29343A,
              32px 0px 0px 0px white;
  
  position:relative;
}
div .sidebar .exitMenu input{
  display:none;
}

div .sidebar .exitMenu label{
  border-style:solid;
  border-color:white;
  border-radius:50%;
  border-width:5px;
  width:20px;
  height:20px;
  margin-left:-10px;
  float:left;
  
  position:absolute;
  bottom:35px;
}

div .sidebar .exitMenu input:checked ~ label{
  border-style:double;
}

div .sidebar .exitMenu input:checked ~ .finishButton{
  bottom:-100px;
}

div .sidebar label:not(:first-child):hover{
  opacity:.8;
  cursor:pointer;
}

div .header .path{
   margin-top:15px;
}

div .header .path p{
  color:rgba(255,255,255,.7);
  float:left;
}
div .header .path p:hover{
  color:rgba(255,255,255,1);
  cursor:pointer;
}

div .header .path p:not(:first-child):before{
  content: ">";
  margin:0px 10px;
	display:block-inline;
  color:#456;
  font-weight:bold;
}

div .header .logo{
  margin-top:10px;
  margin-right:180px;
  float:right;
  font-size:25px;
}

div .header .logo:after {
	content: "By Rikard Legge";
  color:#2A4C6F;
}


div .sidebar{
  background:#29343A;
  width:80px;
  position:fixed;
  height:100%;
}

div .content{
  margin-left:80px;
  
  padding-top:110px;
  padding-left:80px;
  padding-right:80px;
}

.content h1{
  font-size:40px;
  color: rgba(150,150,150, 0.8);
  text-shadow: 0px 0px 6px #def, 0 0 0 #000, 0px 0px 6px #def;
  padding:5px;
  outline: none;
  transition:.2s;
}

h1:focus{
  background:white;
  border-radius:5px;
  box-shadow:inset 0px 0px 5px 0px grey;
  text-shadow: none;
  color:#444;
}
h1:hover{
  background:white;
  border-radius:5px;
  box-shadow:inset 0px 0px 5px 0px grey;
  text-shadow: none;
  color:#444;
}

::selection {
background-color: #444;
color: #ffffff;
}

.content #contentText{
  width:100%;
  border:none;
  min-height:200px;
  
  border-radius:10px;
  
  padding: 20px;
  outline: none; 
  resize: none;
  
  font-family: Arial, Helvetica, sans-serif;
  font-size:16px;
  
  line-height:180%;
  margin-bottom:30px;
  margin-top:30px;
  transition:.2s;
}

.content #contentText:focus{
  background:white;
  box-shadow: inset 0px 0px 4px -1px black;
}
.content #contentText:hover{
  background:white;
  box-shadow: inset 0px 0px 4px -1px black;
}

.textEditing{
  margin-left:8px;
}

.textEditing input{
  display:none;
}

.textEditing span{
  margin:0px;
  margin-left:-5px;
  cursor:pointer;
}

.textEditing #link{
  display:inline-block;
  position:absolute;
  margin-top:17px;
  width:0;
  transition:.4s;
  overflow:hide;
  border:none;
}

.textEditing input:first-child + label span:after {
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
}

.textEditing input:nth-last-child(2) + label span:after {
  border-top-right-radius: 7px;
  border-bottom-right-radius: 7px;
}

.textEditing span:after {
	content: "";
	display:inline-block;

	width: 65px;
	height: 50px;
  
  border-color:#B8C3CB;
  border-width:1px;
  border-style:solid;
	background-color:#F2F6F8;
}

.textEditing #linkLable span:after{
  background:#29343A;
  transition:.4s;
  width:0px;
}

.textEditing input:checked + label span:after {
    background-color:#29343A;
  color:#fff;
}

.textEditing input:checked + label span {
  color:#fff;
}

.textEditing #attachment:checked ~ #linkLable span:after {
  width:320px;
}

.textEditing #attachment:checked ~ #link {
  width:300px;
}

.textEditing span:hover:after {
    background-color:white;
}

div .finishButton {
  padding-top:20px;
  padding-bottom:20px;
  width:calc(100% - 80px);
  margin-left:80px;
  position:fixed;
  bottom:0;
  background:#E5EBEF;
  transition:.3s ease;
  
  box-shadow: 0px 0px 0px #fff, 0px 0px 5px #888;
}

.finishButton a{
    background-color: #999;
    border-radius: 7px;
    border-width:1px;
    border-color:#eee;
    border-style:solid;
  
    color: #fff;
    display: inline-block;
    margin-right: 20px;
    padding: 15px 0px;
    width:130px;
    text-align:center;
    text-decoration: none;
    vertical-align: middle;
}

.finishButton a:hover{
   box-shadow:inset 0px 0px 3px black;
}

#publish{
    background-color: #57D36B;
    margin-left:80px;
}
#save{
    background-color: #62B1DF;
    margin-left:10px;
}
#delete{
    background-color: #E37668;
    position:absolute;
    right:50px;
}

input{
   outline: none; 
}
              
            
!

JS

              
                /* Inspiration http://dribbble.com/shots/1052225-Webnetix-CMS/attachments/128535 */

$( "#contentText" ).keyup(function() {
  $( "#exitMenuCheckbox" ).prop('checked', true);
});


$( "#bold" ).change(function() {
  if($('#bold').prop('checked')){
    $("#contentText").css("font-weight","bold");
  }else{
    $("#contentText").css("font-weight","normal");
  }
});

$( "#italic" ).change(function() {
  if($('#italic').prop('checked')){
    $("#contentText").css("font-style","italic");
  }else{
    $("#contentText").css("font-style","normal");
  }
});

$( "#underline" ).change(function() {
  if($('#underline').prop('checked')){
    $("#contentText").css("text-decoration","underline");
  }else{
    $("#contentText").css("text-decoration","none");
  }
});

$( "#left" ).click(function() {
  $("#contentText").css("text-align","left");
});
$( "#center" ).click(function() {
  $("#contentText").css("text-align","center");
});
$( "#right" ).click(function() {
  $("#contentText").css("text-align","right");
});
$( "#justify" ).click(function() {
  $("#contentText").css("text-align","justify");
});

$(document).on('scroll', function() {
   $( "#exitMenuCheckbox" ).prop('checked', true);
});

$( "#publish" ).mouseup(function() {
  $("#articleHeaderName").text($("h1").text());
});

$( "#save" ).mouseup(function() {
  $("#articleHeaderName").text($("h1").text()+" (Draft)");
});

$( "#delete" ).mouseup(function() {
  $("#articleHeaderName").text("Create New Article");
  $("h1").text("Simple blog editor - A great way of learning");
  $("#contentText").text("Clered");
});
              
            
!
999px

Console