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.


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.

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.


                <div class="container">
  <div class="hover-container">
    <h1>Underline Link Effect</h1>
    <p><small>(hover over above text please)</small></p>
  <p class="body-text">I made this little pen because I kept forgetting how to achieve this effect. </p>
  <p class="body-text"><strong>Note:</strong> Edit <code>transform-origin</code> to change how where the animation starts. It's currently set to <code>left</code>.<br /> <a href="">Read more about this property on MDN.</a> </p>



                /* the code you want is around line 45  */

@import url(",700");

* {
  padding: 0;
  margin: 0;

html {
  box-sizing: border-box;
*:after {
  box-sizing: inherit;

body {
  font-family: Montserrat, sans-serif;
  height: 100%;
  min-height: 100vh;
  background-color: #ebf3ff;

.container {
  display: flex;
  flex-flow: column;
  width: 60%;
  height: 100vh;
  margin: 0 auto;
  align-items: center;
  justify-content: center;

.hover-container {
  text-align: center;
  margin-bottom: 2em;

.body-text {
  margin: 0.5em 0;

/* --- this is the code you probably want ---- */

h1 {
  border-bottom: 3px solid #ff8cbc;
  font-size: 3em;
  transition: all 0.25s linear;
  position: relative;

h1:before {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background-color: #61a3ff;
  position: absolute;
  left: 0;
  bottom: -3px; /* this is to match where the border is */
  transform-origin: left; 
  transform: scale(0);
  transition: 0.25s linear;
/*   will-change: transform; */

h1:hover:before {
  transform: scale(1);