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>Blocks</h1>

<h2>Block Links</h2>

<div>

  <article class="default">
    <a href="https://example.com/linkwrap" rel="nofollow">
      <h3>Wrapping Entire Thing</h3>
      <img src="https://www.fillmurray.com/640/360" width="640" height="360" alt="Bill Murray on the award carpet.">
      <p>
        Gastropub sartorial venmo hashtag, franzen actually umami small batch vinyl taiyaki. Seitan organic dreamcatcher
        pinterest, tilde franzen ugh tattooed PBR&B etsy bitters brooklyn yuccie listicle bicycle rights. Keytar
        keffiyeh glossier roof party. YOLO palo santo godard, organic lomo roof party tumeric affogato bicycle rights.
      </p>
    </a>
  </article>

  <article class="block">
    <h3><a href="https://example.com/heading" rel="nofollow">Only on Heading</a></h3>
    <img src="https://www.fillmurray.com/600/380" width="600" height="380" alt="Bill Murray in a still from Caddyshack.">
    <p>
      Tumeric prism tattooed, raw denim cloud bread 90's cred plaid shabby chic aesthetic scenester snackwave
      fingerstache gochujang twee. Crucifix readymade hoodie +1 tote bag stumptown iceland umami. Edison bulb plaid
      vegan activated charcoal la croix vape paleo shabby chic slow-carb taiyaki. Pour-over cliche slow-carb unicorn.
    </p>
  </article>

  <article class="block">
    <h3 id="A3">Somewhere in the Text</h3>
    <img src="https://www.fillmurray.com/580/320" width="580" height="320" alt="Close-up black-and-white of Bill Murray">
    <p>
      Sriracha actually cred portland beard kickstarter williamsburg direct trade cardigan brooklyn pinterest vape paleo
      readymade iPhone. Narwhal helvetica hammock mixtape aesthetic ramps shaman mustache try-hard small batch bicycle
      rights meh. Green juice tacos twee, offal everyday carry la croix PBR&B. Try-hard roof party flannel. <a
        href="https://example.com/text" rel="nofollow" aria-describedby="A3">Read more…</a>
    </p>
  </article>

</div>

<h2>Block Link Variations</h2>

<div>

  <article class="block reorder">
    <h3><a href="https://example.com/re-ordered" rel="nofollow">Art Visually Above Heading</a></h3>
    <img src="https://placekitten.com/680/380" width="680" height="380" alt="Kitten resting against a scratching post.">
    <p>
      This looks perfect. Just Photoshop out the dog, add a baby, and make the curtains blue. There are more projects
      lined up; charge extra the next time. Can you make the logo bigger? Yes, bigger. Bigger still. The logo is too
      big. You can get my logo from Facebook. The target audience is males and females aged zero and up, so make it
      original. Can you rework to make the pizza look more delicious?
    </p>

  </article>

  <article class="block reorder extracta">
    <h3><a href="https://example.com/extraCTA" rel="nofollow">With Another Call to Action</a></h3>
    <img src="https://placekitten.com/600/320" width="600" height="320" alt="Kitten staring into camera.">
    <p>
      What do you feel you would bring to the table if you were hired for this position? Core competencies? Blue sky
      wheelhouse. Product market fit shelfware performance review. Please use "solutionise" instead of solution ideas!
      Proceduralize. Can I just chime in on that one, get all your ducks in a row, so corporate synergy.
    </p>
    <p>
      <a href="https://example.com/" rel="nofollow">Order Your Own!</a>
    </p>
  </article>

</div>

<h2>Block Buttons</h2>

<div>

  <section class="default">
    <button type="button" onclick="alert('You look nice in those shoes.');">
      <h3>Wrapping Entire Thing</h3>
      <p>
        Hundreds of thousands how far away not a sunrise but a galaxyrise paroxysm of global death gathered by gravity
        preserve and cherish that pale blue dot?
      </p>
      <p>
        <span>Settings</span>
      </p>
    </button>
  </section>

  <section class="block">
    <h3>Only on Settings Text</h3>
    <p>
      Hundreds of thousands how far away not a sunrise but a galaxyrise paroxysm of global death gathered by gravity
      preserve and cherish that pale blue dot?
    </p>
    <button type="button" onclick="alert('You look nice in that shirt.');">
      <span>Settings</span>
    </button>
  </section>

</div>

<p>
  Used in my blog post <cite><a href="https://adrianroselli.com/2020/02/block-links-cards-clickable-regions-etc.html">Block Links, Cards, Clickable Regions, Etc.</a></cite>.
</p>
              
            
!

CSS

              
                body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
  /*   line-height: 1.5; */
  /*   letter-spacing: 0.12em; */
  /*   word-spacing: 0.16em; */
  color: #333;
  background: #efefef;
}

div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

div > * {
  padding: .5em 1em;
  margin: 0 0.5em 1em 0.5em;
  flex: 0 1 20em;
  border: .2em solid rgba(0,0,0,.15);
  border-radius: 1em;
  background-color: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

h3 {
  margin: .2em 0;
  line-height: 1.2;
}

p {
  margin: .2em 0;
}

a:focus, a:hover {
  text-decoration: none;
}

.default a:link {
  text-decoration: none;
  color: #333;
}

.default a:focus h3, .default a:hover h3 {
  color: #00f;
  text-decoration: underline;
}

button {
  font: inherit;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

button:focus, button:hover {
  outline: none;
}

button span {
  display: block;
  text-align: center;
  padding: .5em 1em;
  margin: .5em 1em;
  border: .1em solid #00c;
  border-radius: .25em;
  background-color: #00c;
  color: #fff;
}

button:focus span, button:hover span {
  color: #00c;
  background-color: #fff;
}

/* Move the image above the heading */

.reorder {
  display: flex;
  flex-direction: column;
  padding-top: .5em;
}

.reorder img {
/*  see comment on post  */
  order: -1;
}

/* .reorder h3 {
  order: 2;
}

.reorder p {
  order: 3;
} */

/* Block links */

.block {
  position: relative;
}

.block a[href]::after, .block button::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.block:hover, .block:focus-within, .default:hover, .default:focus-within {
  border-color: rgba(0,0,255,.5);
  box-shadow: 0 0 .5em rgba(0,0,0,.25);
}

/* Help out IE */

.block a[href]:hover, .block a[href]:focus {
  outline: .4em solid rgba(0,0,255,.25);
  outline-offset: .25em;
}

/* Undo the IE */

.block:hover a[href]:hover, .block:hover a[href]:focus, .block:hover button:focus, .block:hover button:hover, .block:focus-within a[href]:hover, .block:focus-within a[href]:focus, .block:focus-within button:focus, .block:focus-within button:hover {
  outline: none;
}

/* ------------------------------------ */

/* Now with another link in the block thinger */

.block.extracta a[href]::after {
  bottom: 3.75em;
}

.block.extracta p a[href]::after {
  content: none;
}

.block.extracta p a[href] {
  display: block;
  text-align: center;
  margin: 1em 2em 0 2em;
  padding: .5em 1em;
  border: .1em solid #00c;
  border-radius: .25em;
  text-decoration: none;
  color: #fff;
  background-color: #00c;
}

.block.extracta p a[href]:focus, .block.extracta p a[href]:hover {
  color: #00c;
  background-color: #fff;
}

              
            
!

JS

              
                
              
            
!
999px

Console