Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Auto Save

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

              
                table.lang_list
  tr
    th language
    td Ruby
  tr
    th framework
    td
      dl.inner-list
        dt.accordion Ruby on Rails
        dd
          strong
            | Ruby on Rails, or Rails, is a server-side web application framework
          br
          | Ruby on Rails, or Rails, is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer, and HTML, CSS and JavaScript for display and user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), and the active record pattern.
        dt.accordion Sinatra
        dd
          strong
            | Sinatra is a free and OSS web app library and domain-specific language
          br
          | Sinatra is a free and OSS web application library and domain-specific language written in Ruby. It is an alternative to other Ruby web application frameworks such as Ruby on Rails, Merb, Nitro, and Camping. It is dependent on the Rack web server interface. It is named after musician Frank Sinatra.

              
            
!

CSS

              
                .lang_list {
  width: 100%;
  tr {
    border-bottom: solid 1px #333;
  }
  th, td {
    padding: 10px;
  }
  th {
    vertical-align: middle;
    padding: 0 10px;
  }
  td {
    width: 80%;
    //margin-left: 20%;
    .inner-list {
      dt, dd {
        padding: 8px 0;
      }
      .accordion {
        font-weight: normal;
        color: #999;
        &:hover {
          cursor: pointer;
          opacity: .8;
        }
        &:after {
          content: "▼"
        }
        &.open:after {
          content: "▲"
        }
      }
      dd {
        height: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        border-bottom: 1px solid #ddd;
        &:last-child {
          border: none;
        }
      }
    }
  }
}
              
            
!

JS

              
                $(".accordion").on "click", ->
  target = $(this).next()
  $(this).toggleClass('open')
  if $(this).hasClass('open')
    resizeHeight = target.get(0).scrollHeight
    target.attr('data-org-height', target.innerHeight())
    target.animate({"height": resizeHeight});
  else
    orgHeight = target.attr('data-org-height');
    target.animate({"height": orgHeight});

              
            
!
999px

Console