cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <!-- See HTML below for all the data-attributes used -->

<div class="articulate-area">
  <button onclick="speak('article')">Speak/Pause</button>
  <button onclick="stop()">Stop</button>
</div>

<article>
  <div class="intro">
    <h1>The Gettysburg Address</h1>
    <h2>Delivered by <span data-articulate-swap="President">Abraham</span> Lincoln on November 19, 1863</h2>
    <h4 data-articulate-prepend="For those listening,">Note the peculiar spelling of the town name: <span data-articulate-spell>Gettysburg</span></h4>
    <hr>
  </div>
  
  <!-- <articulate>What follows is an excerpt of the speech.</articulate> -->
  
  <div class="speech" data-articulate-append="This concludes the excerpt.">
    <p>Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</p>
    <p>Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war.</p>
    <hr>
  </div>
  
  <h4 data-articulate-ignore>For the rest of the speech, see the <a href="#">Wikipedia page</a></h4>
</article>
            
          
!
            
              body {
  width: 95%;
  max-width: 800px;
  font-family: tahoma;
  background-color: #eee;
  padding: 20px 0 20px 0;
  margin: 0 auto 0 auto;
}
  
img {
  width: 100%;
}
  
h1 {
  font-size: 22px;
  text-align: center;
  margin: 0 0 10px 0;
}

h2 {
  font-size: 16px;
  text-align: center;
  margin: 0 0 15px 0;
}

h3 {
  font-size: 16px;
  font-weight: normal;
  text-align: center;
  margin: 0 0 15px 0;
}
  
h4 {
  font-size: 16px;
  font-weight: normal;
  text-align: center;
  margin: 0 0 15px 0;
}
  
p {
  font-size: 14px;
  line-height: 1.4;
}

div.articulate-area {
  font-family: monospace;
  font-size: 14px;
  text-align: center;
  padding: 0 0 15px 0;
  border-bottom: 1px dotted #666;
  margin: 0 0 20px 0;
}
            
          
!
            
              function speak(obj) {
  var speaking = $().articulate('isSpeaking');
  var paused = $().articulate('isPaused');
  
  // This is how you can use one button for a speak/pause toggle
  // Is browser speaking? (This returns 'true' even when paused)
  // If it is, is speaking paused? If paused, then resume; otherwise pause
  // If it isn't, then initiate speaking

  if (speaking) {
    if (paused) {
      $().articulate('resume');
    } else {
      $().articulate('pause');
    }
  } else {
    $(obj).articulate('speak');
  };
};

function stop() {
  $().articulate('stop');
};
            
          
!
999px
Loading ..................

Console