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 includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


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.


                <div id="container">
  <h1>To-Do List <i class="fa fa-pencil-square-o" aria-hidden="true"></i></h1>
  <input type="text" placeholder="add new item">
    <li><span><i class="fa fa-trash"></i></span> make the potions<i class='fa fa-square-o'></i></li>
    <li><span><i class="fa fa-trash"></i></span> buy new velvet robe<i class='fa fa-square-o'></i></li>
    <li><span><i class="fa fa-trash"></i></span> visit hagrid<i class='fa fa-square-o'></i></li>


                html {
  height: 100%;
  background: #f7f7f7;  /* fallback for old browsers */
  background: -webkit-linear-gradient(to bottom, #ffffff, #f7f7f7, #7662f1);  /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to bottom, #ffffff, #f7f7f7, #7662f1); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  font-family: roboto;
  margin: 0;
  background-repeat: no-repeat;
  background-attachment: fixed;
  box-shadow: 0 0 50px rgba(118, 98, 241, 1); 
  background: #f7f7f7;
  width: 360px;
  max-width: 100%;
  margin: 100px auto;
  margin: 0;
  background: #7662f1;
  color: #ffffff;
  padding: 10px 20px;  
  text-transform: uppercase;
  font-size: 24px;
  font-weight: normal;
  float: right;
  cursor: pointer;
  border: .5px solid #fff;
  border-radius: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 40px;
  line-height: 40px;
  color: #666;
  font-size: 18px;
  background-color: #f7f7f7;
  width: 100%;
  border: rgba(0,0,0,0);
  padding: 13px 13px 13px 20px;
  box-sizing: border-box;
  color: #7662f1;
  display: none;
  background: #fff;
  border: 3px solid #7662f1;
  outline: none;
.fa-square-o, .fa-check-square-o{
  float: right;
  line-height: 40px;
  margin-right: 10px; 
/*   height: 40px; */
  color: gray;
  background: transparent;
  cursor: pointer;
  color: gray;
  text-decoration: line-through;
  text-align: center;
  margin-right: 20px;
  height: 40px;
  width: 0;
  display: inline-block;
  color: #fff;
  background: #e74c3c;
  cursor: pointer;
  opacity: 0;
  transition: 0.2s linear;
li:hover span{
  width: 40px;
  opacity: 1.0;
@media only screen and (max-width: 500px) {
    #container {
      margin: 20px auto;


                //check off
$("ul").on("click", ".fa-square-o", function(){
//click on trash to delete
$("ul").on("click", "span", function(){
  $(this).parent().fadeOut(500, function(){
//add new
  if(event.which === 13){
    //capture text
    var todoText = $(this).val();
    $("ul").append("<li><span><i class='fa fa-trash'></i></span> "+todoText+"<i class='fa fa-square-o'></i></li>");