Pen Settings



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


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.


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.


                <figure id="video-track-container">
  <video controls id="downtown-los-angeles" autoplay >
    <source src="">
    <source src="">        <track kind="chapters" label="Locations" src="" srclang="en" default type="text/vtt" >
  <figcaption tabindex="0" role="menu" aria-label="Message Log">
    <ol id="chapters">



                * { 
  box-sizing: border-box;
  font-family: Avenir, Helvetica, sans-serif;
body { margin: 0; }
figure#video-track-container { 
  font-size: 0; 
  position: relative; 
  background: #000; 
  margin: 0; 
figure#video-track-container video { 
  width: 75%;
  height: auto;
  display: inline-block; 
figure#video-track-container figcaption { 
  position: absolute; 
  right: 0; top: 0;
  background: #222; 
  width: 25%; 
  font-size: .8rem; 
  color: #666; 
  height: 100%; 
  overflow-y: scroll; 
figure#video-track-container figcaption ol { 
  position: relative;
  list-style-type: none;
  margin: 0; 
  padding: 0; 
figure#video-track-container figcaption ol li a { 
  display: block; 
  padding: .7rem 1rem; 
  border-bottom: 1px dashed #000; 
  transition: .3s;
.current { 
  background: hsl(45,80%,50%); 
  color: #000;  
figure#video-track-container figcaption ol li a:not(.current):hover, 
figure#video-track-container figcaption ol li a:not(.current):focus { 
  background: hsl(45,80%,30%); 
  color: #000; 
  cursor: pointer;
figure#video-track-container figcaption::-webkit-scrollbar {
    width: 13px;
    height: 100%;
figure#video-track-container figcaption::-webkit-scrollbar-track {
    background-color: #000; 
figure#video-track-container figcaption::-webkit-scrollbar-thumb:vertical {
    background: hsl(45,80%,20%);
    width: 13px;
    height: 20px;

@media screen and (max-width: 500px) {
  figure#video-track-container video, 
  figure#video-track-container figcaption { 
    display: block; 
    width: 100%;
  figure#video-track-container video { 
    border-bottom: 10px solid #111;
figure#video-track-container figcaption { 
  position: static; 
  height: 200px;



                // Tracks are currently offline due to cross-origin issues

var locationList = document.getElementById("chapters"),
video = document.getElementById("downtown-los-angeles"),
trackElement = video.getElementsByTagName("track")[0];
video.addEventListener("loadedmetadata", function run_tests() {
      if (trackElement.readyState == 1) { setTimeout(run_tests, 0); } else { displayChapters(); }

function displayChapters(){
  if ((trackElement.readyState == 2) && (textTrack = trackElement.track) && (window.matchMedia("(min-width: 500px)").matches)){
        if(textTrack.kind === "chapters"){
            textTrack.mode = 'hidden';
            for (var i = 0; i < textTrack.cues.length; ++i) {
                var cue = textTrack.cues[i],
                chapterName = cue.text,
                start = cue.startTime,
                newLocale = document.createElement("li"),
                location = document.createElement("a");
                location.setAttribute('id', start);
                location.setAttribute('tabindex', '0');
                var localeDescription = document.createTextNode(cue.text);
                function() {
                	video.currentTime =;
                }, false);
		   function() {
                var currentLocation = this.activeCues[0].startTime;
                if (chapter = document.getElementById(currentLocation)) {
                	var locations = []"#chapters li a"));
                	for (var i = 0; i < locations.length; ++i) { locations[i].classList.remove("current"); } 
                  // = "-"+chapter.parentNode.offsetTop+"px";
                  // alternative approach, as scrollIntoView will cause entire page to jump if video is not at top of page