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

              
                <h1 id="stop">Hashtag Links with Margin</h1>
<ol class="list">
  <li><a href="#sone">Section One</a></li>
  <li><a href="#stwo">Section Two</a></li>
  <li><a href="#sthree">Section Three</a></li>
  <li><a href="#sfour">Section Four</a></li>
</ol>
<h2 id="sone" class="xtarget">Section One <a class="up" href="#top">〈</a><a class="down" href="#stwo">〈</a></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eget tempus erat. Sed ipsum quam, scelerisque id sollicitudin eget, laoreet in tortor. Nulla semper ipsum arcu, eget tempor nisl egestas eu. Mauris aliquam, eros a lobortis eleifend, orci quam aliquam dui, nec ultricies dui nibh sit amet ante. Suspendisse id mattis mauris, nec hendrerit elit. Phasellus accumsan tristique enim in euismod. In sit amet nunc vel eros elementum dictum. Etiam rutrum diam ut dictum finibus. Nulla consequat fringilla orci a porttitor. Ut at consequat nisl. Nam ultricies tempor metus at sagittis. Curabitur ut blandit enim. Nulla eget accumsan diam, eu dapibus ipsum. Fusce orci leo, volutpat et sapien vel, gravida elementum arcu.</p>
<h2 id="stwo" class="xtarget">Section Two <a class="up" href="#sone">〈</a><a class="down" href="#sthree">〈</a></h2>
<p>In quis ultrices nibh. Morbi et urna dignissim, pretium magna nec, aliquam ex. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer semper justo eu sem tempor venenatis. Aenean elementum augue ante, sed consectetur metus efficitur id. Pellentesque varius lectus eget eleifend iaculis. Praesent posuere tellus non velit posuere pulvinar. Maecenas luctus dignissim suscipit. Ut vehicula erat a risus gravida sollicitudin. Suspendisse quam risus, tincidunt eu dapibus eu, suscipit id arcu.</p>
<h2 id="sthree" class="xtarget">Section Three <a class="up" href="#stwo">〈</a><a class="down" href="#sfour">〈</a></h2>
<p>Nullam consequat lectus eget magna interdum dapibus. Nam cursus aliquam commodo. Nullam interdum eleifend odio eu iaculis. Etiam convallis pellentesque erat, eget pharetra nulla tristique at. Proin auctor augue eleifend bibendum gravida. Phasellus pharetra hendrerit arcu sed suscipit. Proin quis maximus felis. Vestibulum pharetra lectus in metus sodales, ac volutpat augue euismod. Donec quis scelerisque augue, ullamcorper tincidunt nulla. Etiam tempor nibh ut tellus porttitor venenatis. Phasellus aliquam aliquet purus, sit amet luctus quam fermentum ultrices. Donec aliquam elit vel lectus sollicitudin lacinia lacinia gravida ipsum. Donec id justo nibh. Curabitur vulputate libero vitae lectus facilisis, vel mollis nisl fermentum. Vestibulum at ultrices nulla. Etiam feugiat sem eget turpis semper posuere.</p>
<h2 id="sfour" class="xtarget">Section Four <a class="up" href="#sthree">〈</a></h2>
<p>Integer ultrices efficitur tincidunt. Mauris sed leo eget ante cursus posuere. Mauris sit amet elit ut enim fermentum hendrerit eu in augue. Praesent vitae auctor tortor. Quisque pretium est vitae vehicula ultricies. Etiam libero nisi, molestie sit amet justo quis, fringilla tempor odio. Sed vitae nisl in nisi dictum bibendum. Integer porttitor, nunc in bibendum lobortis, ex nunc volutpat massa, eu vestibulum metus magna eget metus. Nunc eleifend placerat ante, sed interdum sem laoreet eget. Pellentesque et diam sed enim rutrum ornare. Donec eget velit in mi eleifend auctor. Nullam elementum nulla eu dui congue ultricies. Phasellus quis tellus eget nibh accumsan feugiat eu non risus.</p>
              
            
!

CSS

              
                body { color:#777; font-family:'Lato', sans-serif; font-size:16px; line-height:1.714; max-width:600px; margin:24px auto 48px; padding:1.5em; }
a { color:#2bbbb3; text-decoration:none; -webkit-transition:.2s; transition:.2s; }
a:hover { color:#31d4cc; border-bottom:1px dotted; }

/* Style :target with margin & transition. The 's' can be changed to whatever works (I used it here to represent 'sections'). Adjust transition speed to .001s for instantaneous. */
.xtarget:target { color:#2bbbb3; margin-top:-12px; padding-top:60px; }

/* Add 'Currently Reading' to targeted section (optional) */
.xtarget:target:before { content:'Currently Reading'; font-family:'Open Sans', sans; font-size:12px; background:#ccc; border-radius:3px; background-clip:padding-box; color:#fff; padding:0 5px; position:absolute; top:24px; }

/* Navigation arrows for list items (optional) */
h1, h2 { color:#5e5e5e; font-family:'Georgia', Georgia, serif; font-weight:400; letter-spacing:-.025em; }
h1 { font-size:36px; }
h2 { position:relative; font-size:24px; margin:36px 0 12px; }
h2 a { font-size:16px; border:1px solid #efefef; border-radius:1000px; background-clip:padding-box; display:inline-block; width:24px; height:36px; line-height:38px; margin-left:15px; vertical-align:middle; }
h2 a:hover { color:#fff; background:#2bbbb3; }
h2 a.up {
-ms-transform:rotate(90deg); /* IE 9 */
-webkit-transform:rotate(90deg); /* Safari and Chrome */
transform:rotate(90deg); }
h2 a.down {
-ms-transform:rotate(-90deg); /* IE 9 */
-webkit-transform:rotate(-90deg); /* Safari and Chrome */
transform:rotate(-90deg); }
p { color:#777; font-size:18px; line-height:1.714; font-weight:300; letter-spacing:.01em; margin-bottom:24px; }

/* Hover Selectors to list (optional) */
.list li { position:relative; padding-bottom:6px; }
.list li:hover:before { content:'›'; color:#2bbbb3; position:absolute; left:-40px; line-height:1.2; }
              
            
!

JS

              
                
              
            
!
999px

Console