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>Inline links with large activation target</h1>
<p>An attempt to make the effective activation (touch) target for an inline link large enough to make it comfortably clickable/tappable. Relies on setting a generous <code>padding</code> (visualised here with a light green background), pulled back on the left and right by an equal amount of negative <code>margin</code>, combined with some CSS <code>pointer-events</code> juggling to make sure clicks/taps go <strong>through</strong> any of the subsequent lines of text in the paragraph. Of course, this is still problematic when two links on separate lines are too close together, with their effective activation targets overlapping...but it's perhaps a start. Additionally, this demo also forces a focus outline that's inset by the same amount as the padding.</p>
<hr>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut <a href="#">link</a> labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem <a href="#">link</a> ipsum dolor sit amet, consetetur sadipscing elitr, <a href="#">link</a> sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum <a href="#">link</a> dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor <a href="#">link</a> invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
              
            
!

CSS

              
                body { font-family: Helvetica, Arial, sans-serif; line-height: 1.5}
code { font-size: 1.4em; background: #eee; padding: 0 0.25em; }
a { background: rgba(0,256,0,0.2); color: #000; padding: 1em; margin: 0 -1em; pointer-events: auto; border: 1px rgba(0,100,0) solid; }
a:focus { outline: 2px red solid; outline-offset: -1em}
p { pointer-events: none; }
              
            
!

JS

              
                var a = document.querySelectorAll('a');
for (i = 0; i < a.length; ++i) {
  a[i].addEventListener('click', function() { alert('Link clicked...')}, true);
}
              
            
!
999px

Console