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

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.

HTML

              
                <!-- Main container -->
<section class="container">
  <!-- Section context -->
  <div class="context">
    <div class="context__inner">
      <h1>Link &amp; CTA Styling</h1>
      <p>Links are found in nearly all web pages. Links allow users to click their way from page to page. You can click on a link and jump to another destination. When you move the mouse over a link, the mouse arrow will turn into a little hand and the visual styling will adjust.</p>
    </div>
  </div>
  <!-- /Section context -->
  <!-- CTA examples -->
  <div class="ctas">
    <div class="ctas__inner">
      <div class="ctas__inner-separator">
        <a class="link" href="javascript:;">Standard text link</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta outline small" href="javascript:;">SM Outline</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-blue small" href="javascript:;">SM Fill</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-orange small" href="javascript:;">SM Fill</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta outline medium" href="javascript:;">MD Outline</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-blue medium" href="javascript:;">MD Fill</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-orange medium" href="javascript:;">MD Fill</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta outline large" href="javascript:;">LG Outline</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-blue large" href="javascript:;">LG Fill</a>
      </div>
      <div class="ctas__inner-separator">
        <a class="cta fill-orange large" href="javascript:;">LG Fill</a>
      </div>
    </div>
  </div>
  <!-- /CTA examples -->
</section>
<!-- /Main container -->
              
            
!

CSS

              
                // Import fonts
@import url('https://fonts.googleapis.com/css?family=Fjalla+One|Libre+Franklin|Source+Sans+Pro');

// Variables
$orange: #DB633F;
$blue: #506B7F;
$blueDark: #2A3C48;
$blueGray: #BFD1DE;
$gray: #F1F4F7;
$white: #FFF;
$libre: 'Libre Franklin', sans-serif;
$source: 'Source Sans Pro', sans-serif;
$fjalla: 'Fjalla One', sans-serif;

// Load them fonts
html {
  font-size: 62.5%;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.25px;
  font-family: $fjalla;
  text-transform: uppercase;
  text-align: left;
  margin: 0 0 8px;
}

p {
  font-size: 1.6rem;
  line-height: 24px;
  letter-spacing: 0.5px;
  font-family: $source;
  text-align: left;
}

// Page structure
.container {
  width: percentage(12/12);
  
  @media screen and (min-width: 1440px) {
    display: flex;
    flex-direction: row;
  }
  
  .context {
    color: $blue;
    background: $gray;
    width: percentage(12/12);
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 24px 0;
    
    @media screen and (min-width: 768px) {
      height: 35vh;
      align-items: center;
      padding: 0;
    }
    
    @media screen and (min-width: 1440px) {
      width: percentage(4/12);
      height: auto;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      padding: 80px 0 0 0;
    }
    
    &__inner {
      width: percentage(10/12);
      
      @media screen and (min-width: 768px) {
        width: percentage(8/12);
      }
      
      @media screen and (min-width: 1440px) {
        width: percentage(3/4);
        padding: 0 percentage(0.5/4);
      }
      
    }
    
  }
  
  .ctas {
    background: $white;
    width: percentage(12/12);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 24px 0;
    
    @media screen and (min-width: 768px) {
      height: 65vh;
      justify-content: center;
      padding: 0;
    }
    
    @media screen and (min-width: 1440px) {
      width: percentage(8/12);
      height: auto;
    }
    
    &__inner {
      width: percentage(10/12);
      
      @media screen and (min-width: 768px) {
        width: percentage(8/12);
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
      }
      
      @media screen and (min-width: 1440px) {
        width: percentage(6/8);
        padding: 80px 0;
      }
      
      &-separator {
        margin: 24px 0 0;
        
        &:first-child {margin: 0;}
        
        @media screen and (min-width: 768px) {
          margin: 24px 32px 0 0;
          
          &:first-child {margin: 24px 32px 0 0;}
          
          &:last-child {margin: 24px 0 0;}
          
        }
        
        @media screen and (min-width: 1440px) {
          margin: 0 24px 40px 0;
          
          &:first-child {margin: 0 24px 40px 0;}
          
          &:last-child {margin: 0 0 40px;}
          
        }
        
      }
      
    }
    
  }
  
}

// Link & CTA styling
a {
  transition: all 500ms cubic-bezier(0.19, 1, 0.22, 1);
  
  // Text link
  &.link {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.6rem;
    line-height: 24px;
    letter-spacing: 0.5px;
    color: $orange;
    text-decoration: underline;
    
    // Hover state
    &:hover {
      color: darken($orange, 15%);
    }
    
  }
  
  // CTA link
  &.cta {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1rem;
    line-height: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    &.outline {
      color: $blue;
      border: solid 1px $blue;
      border-radius: 2px;
    }
    
    &.fill-blue {
      color: $gray;
      background: $blue;
      border: solid 1px $blue;
      border-radius: 2px;
    }
    
    &.fill-orange {
      color: $gray;
      background: $orange;
      border: solid 1px $orange;
      border-radius: 2px;
    }
    
    &.small {
      min-width: 112px;
      height: 40px;
    }
    
    &.medium {
      min-width: 144px;
      height: 48px;
    }
    
    &.large {
      min-width: 224px;
      height: 56px;
    }
    
    // Hover states
    &:hover {
      transform: scale(1.05);
      
      &.outline {
        color: darken($blue, 10%);
        border: solid 1px darken($blue, 10%);
      }
      
      &.fill-blue {
        background: darken($blue, 10%);
        border: solid 1px darken($blue, 10%);
      }
      
      &.fill-orange {
        background: darken($orange, 10%);
        border: solid 1px darken($orange, 10%);
      }
      
    }
    
  }
  
}
              
            
!

JS

              
                
              
            
!
999px

Console