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

              
                <div class='container'>
  <h1>Menu Links <span>Hover Effects</span></h1>
  <p class='subheader'><a href="https://github.com/eisenfox/menu-links-hover-effects-1" target="_blank">Check on GitHub --></a></p>
  
  <div class="effect-container">
    <h2>Effect #1</h2>
    <div class="menu-hover-effect menu-hover-effect-1">
      <ul>
        <li><a href="#" title="Home">Home</a></li>
        <li><a href="#" title="About">About</a></li>
        <li><a href="#" title="Services">Services</a></li>
        <li><a href="#" title="Feedbacks">Feedbacks</a></li>
        <li><a href="#" title="Contact Us">Contact Us</a></li>
      </ul>
    </div>
  </div>
  
  <div class="effect-container">
    <h2>Effect #2</h2>
    <div class="menu-hover-effect menu-hover-effect-2">
      <ul>
        <li><a href="#" title="Home">Home</a></li>
        <li><a href="#" title="About">About</a></li>
        <li><a href="#" title="Services">Services</a></li>
        <li><a href="#" title="Feedbacks">Feedbacks</a></li>
        <li><a href="#" title="Contact Us">Contact Us</a></li>
      </ul>
    </div>
  </div>
  
  <div class="effect-container">
    <h2>Effect #3</h2>
    <div class="menu-hover-effect menu-hover-effect-3">
      <ul>
        <li><a href="#" title="Home">Home</a></li>
        <li><a href="#" title="About">About</a></li>
        <li><a href="#" title="Services">Services</a></li>
        <li><a href="#" title="Feedbacks">Feedbacks</a></li>
        <li><a href="#" title="Contact Us">Contact Us</a></li>
      </ul>
    </div>
  </div>
  
  <div class="effect-container">
    <h2>Effect #4</h2>
    <div class="menu-hover-effect menu-hover-effect-4">
      <ul>
        <li><a href="#" title="Home">Home</a></li>
        <li><a href="#" title="About">About</a></li>
        <li><a href="#" title="Services">Services</a></li>
        <li><a href="#" title="Feedbacks">Feedbacks</a></li>
        <li><a href="#" title="Contact Us">Contact Us</a></li>
      </ul>
    </div>
  </div>
  
  <div class="effect-container">
    <h2>Effect #5</h2>
    <div class="menu-hover-effect menu-hover-effect-5">
      <ul>
        <li><a href="#" title="Home">Home</a></li>
        <li><a href="#" title="About">About</a></li>
        <li><a href="#" title="Services">Services</a></li>
        <li><a href="#" title="Feedbacks">Feedbacks</a></li>
        <li><a href="#" title="Contact Us">Contact Us</a></li>
      </ul>
    </div>
  </div>
  
</div>
              
            
!

CSS

              
                //variables
$bg-color: #fff; //body bg color
$basic-links-color: #222; //links color
$link-hover-color: #fff; //link hover color
$_cyan: #0F8B8D;
$_ferrari-red: #F42B03;
$_green: #62AB37;
$_copper: #C46D5E;
$_rosewood: #6B0504;
$_cerise: #F00699;

//mixins
@mixin position-absolute ($top: null, $left: null, $right: null, $bottom: null) {
  position: absolute;
  top: $top;
  left: $left;
  right: $right;
  bottom: $bottom;
}

/* common styles !!!YOU DON'T NEED THEM */
body {
  background-color: $bg-color;
  
  .container {
    width: 700px;
    margin: 50px auto 0px;
    text-align: center;
    
    h1 {
      font: {
        family: 'Merriweather Sans', sans-serif;
        weight: 700;
        size: 30px;
      }
      
      span {
        color: #631A86;
        display: inline-block;
        
        &:before {
          content: "/";
          padding-right: 8px;
        }
        
        &:after {
          content: "/";
          padding-left: 8px;
        }
      }
    }
    
    .subheader {
      font: {
        family: 'Merriweather Sans', sans-serif;
        weight: 400;
        size: 15px;
      }
      
      a {
        text-decoration: none;
        color: #C45AB3;
      }
    }
  }
}

.effect-container {
  padding: 20px 0px;
  
  h2 {
    font: {
      family: 'Merriweather Sans', sans-serif;
      weight: 700;
      size: 20px;
    }
  }
  
  .menu-hover-effect {
    margin-top: 40px;
  }
}

/* links styles !!!YOU NEED THEM */

.menu-hover-effect {
  
  font: {
    family: 'Open Sans', sans-serif; /*change to your own font family */
    weight: 400;
    size: 17px;
  }
  
  ul {
    list-style-type: none;
    padding: 0px;
    margin: 0px;
    display: flex;
    justify-content: space-between;
    
    li {
      
      a {
        display: inline-block;
        text-decoration: none;
        position: relative;
        color: $basic-links-color;
        padding: 10px 22px;
      }
    }
  }
}

/* effect 1 styles */

.menu-hover-effect {
  
  &-1 {
    
    a {
      transition: color 0.2s linear 0s;
      
      &:before {
        content: "";
        display: block;
        @include position-absolute($top: 0, $left: 0);
        width: 100%;
        height: 100%;
        background-color: $_cyan; /* set your background-color here */
        border-radius: 30px;
        z-index: -1;
        transform: scale(0.3, 1);
        opacity: 0;
      }
      
      &:hover {
        color: $link-hover-color;
        
        &:before {
          transform: scale(1, 1);
          opacity: 1;
          transition: all 0.2s linear 0s;
        }
      }
    }
  }
}

/* effect 2 styles */

.menu-hover-effect {
  
  &-2 {
    
    a {
      transition: color 0.2s linear 0s;
      
      &:before {
        content: "";
        display: block;
        @include position-absolute($top: 0, $left: 0);
        width: 100%;
        height: 100%;
        background-color: $_ferrari-red; /* set your background-color here */
        border-radius: 4px;
        z-index: -1;
        transform-origin: left top;
        transform: scale(0.1);
        opacity: 0;
      }
      
      &:hover {
        color: $link-hover-color;
        
        &:before {
          transform: scale(1);
          opacity: 1;
          transition: all 0.2s linear 0s;
        }
      }
    }
  }
}

/* effect 3 styles */

.menu-hover-effect {
  
  &-3 {
    
    a {
      transition: color 0.2s linear 0s;
      
      &:before {
        content: "";
        display: block;
        @include position-absolute($top: 0, $left: 0);
        width: 100%;
        height: 100%;
        background-color: $_green; /* set your background-color here */
        border-radius: 10px;
        z-index: -1;
        transform-origin: center center;
        transform: scale(0.1);
        opacity: 0;
      }
      
      &:hover {
        color: $link-hover-color;
        
        &:before {
          transform: scale(1);
          opacity: 1;
          transition: all 0.2s linear 0s;
        }
      }
    }
  }
}

/* effect 4 styles */

.menu-hover-effect {
  
  &-4 {
    
    a {
      transition: color 0.2s linear 0s;
      
      &:before,
      &:after {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        background-color: $_copper; /* set your background-color here */
        border-radius: 10px;
        z-index: -1;
        transform: scale(0.1);
        opacity: 0;
      }
      
      &:before {
        @include position-absolute($top: 0, $left: 0);
        transform-origin: left top;
      }
      
      &:after {
        @include position-absolute($bottom: 0, $right: 0);
        transform-origin: right bottom;
      }
      
      &:hover {
        color: $link-hover-color;
        
        &:before,
        &:after {
          transform: scale(1);
          opacity: 1;
          transition: all 0.3s linear 0s;
        }
      }
    }
  }
}

/* effect 5 styles */

.menu-hover-effect {
  
  &-5 {
    
    a {
      transition: color 0.2s linear 0s;
      
      &:before,
      &:after {
        content: "";
        display: block;
        width: 100%;
        height: 50%;
        background-color: $_cerise; /* set your background-color here */
        z-index: -1;
        transform: scale(1,0.1);
        opacity: 0;
      }
      
      &:before {
        @include position-absolute($top: 0, $left: 0);
        transform-origin: center top;
        border-radius: 10px 10px 0px 0px;
      }
      
      &:after {
        @include position-absolute($bottom: 0, $left: 0);
        transform-origin: center bottom;
        border-radius: 0px 0px 10px 10px;
      }
      
      &:hover {
        color: $link-hover-color;
        
        &:before,
        &:after {
          transform: scale(1);
          opacity: 1;
          transition: all 0.3s linear 0s;
        }
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console