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

              
                <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">


<!-- Consider a wrapper div element, inside that consider a five parent div elements with two different classes, in which one class being same(btn) for all parent elements and other class being different for all
elements(facebook, twitter, google, linkedin, youtube). and inside each parent div element
consider a P tag with text and two span elements with different classes(slider1, slider2) -->


<div class="wrapper">
  <div class="btn facebook">
    <p>facebook</p>
    <span class="slider1"></span>
    <span class="slider2"></span>
  </div>

  <div class="btn twitter">
    <p>twitter</p>
    <span class="slider1"></span>
    <span class="slider2"></span>
  </div>

  <div class="btn google">
    <p>google+</p>
    <span class="slider1"></span>
    <span class="slider2"></span>
  </div>

  <div class="btn linkedin">
    <p>linkedin</p>
    <span class="slider1"></span>
    <span class="slider2"></span>
  </div>

  <div class="btn youtube">
    <p>youtube</p>
    <span class="slider1"></span>
    <span class="slider2"></span>
  </div> 
</div>
              
            
!

CSS

              
                * {
  margin: 0px;
  padding: 0px;
}


body{
  font-family: 'Ubuntu', sans-serif;
  background: #fff;
}

/*  */
.wrapper{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

.btn{
  width: 250px;
  border: 3px solid #000;
  box-sizing: border-box;
  padding: 10px 15px;
  margin-bottom: 20px;
  color: #000;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.7s ease;
}

.btn > p{
  text-align: center;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.btn:hover > p{
  color: #fff;
}

.facebook{
  border: 3px solid #3b5998;
  color: #3b5998;
}

.twitter{
  border: 3px solid#00aced;
  color: #00aced;
}

.google{
  border: 3px solid #dd4b39;
  color: #dd4b39;
}

.linkedin{
  border: 3px solid #007bb6;
  color: #007bb6;
}

.youtube{
  border: 3px solid #bb0000;
  color: #bb0000;
}

.btn .slider1:before,
.btn .slider1:after,
.btn .slider2:before,
.btn .slider2:after
{
  content: "";
  position: absolute;
  transition: all 0.7s ease;
}

/* facebook */
.facebook .slider1:before{
  top: -55px;
  left: 0;
  border-top: 35px solid #3b5998;
  border-bottom: 35px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.facebook .slider1:after{
  left: 0;
  bottom: -55px;
  border-top: 35px solid transparent;
  border-bottom: 35px solid #3b5998;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.facebook .slider2:before{
  top: -3px;
  left: 160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid #3b5998;
  border-left: 125px solid transparent;
}

.facebook .slider2:after{
  top: -3px;
  left: -160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid #3b5998;
}

/* twitter */
.twitter .slider1:before{
  top: -55px;
  left: 0;
  border-top: 35px solid #00aced;
  border-bottom: 35px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.twitter .slider1:after{
  left: 0;
  bottom: -55px;
  border-top: 35px solid transparent;
  border-bottom: 35px solid #00aced;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.twitter .slider2:before{
  top: -3px;
  left: 160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid #00aced;
  border-left: 125px solid transparent;
}

.twitter .slider2:after{
  top: -3px;
  left: -160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid #00aced;
}

/* google */
.google .slider1:before{
  top: -55px;
  left: 0;
  border-top: 35px solid #dd4b39;
  border-bottom: 35px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.google .slider1:after{
  left: 0;
  bottom: -55px;
  border-top: 35px solid transparent;
  border-bottom: 35px solid #dd4b39;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.google .slider2:before{
  top: -3px;
  left: 160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid #dd4b39;
  border-left: 125px solid transparent;
}

.google .slider2:after{
  top: -3px;
  left: -160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid #dd4b39;
}

/* linkedin */
.linkedin .slider1:before{
  top: -55px;
  left: 0;
  border-top: 35px solid #007bb6;
  border-bottom: 35px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.linkedin .slider1:after{
  left: 0;
  bottom: -55px;
  border-top: 35px solid transparent;
  border-bottom: 35px solid #007bb6;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.linkedin .slider2:before{
  top: -3px;
  left: 160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid #007bb6;
  border-left: 125px solid transparent;
}

.linkedin .slider2:after{
  top: -3px;
  left: -160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid #007bb6;
}

/* youtube */
.youtube .slider1:before{
  top: -55px;
  left: 0;
  border-top: 35px solid #bb0000;
  border-bottom: 35px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.youtube .slider1:after{
  left: 0;
  bottom: -55px;
  border-top: 35px solid transparent;
  border-bottom: 35px solid #bb0000;
  border-right: 125px solid transparent;
  border-left: 125px solid transparent;
}

.youtube .slider2:before{
  top: -3px;
  left: 160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid #bb0000;
  border-left: 125px solid transparent;
}

.youtube .slider2:after{
  top: -3px;
  left: -160px;
  border-top: 25px solid transparent;
  border-bottom: 25px solid transparent;
  border-right: 125px solid transparent;
  border-left: 125px solid #bb0000;
}



/* hover effects */
.btn:hover .slider1:before{
  top: 0;
}

.btn:hover .slider1:after{
  bottom: 0;
}

.btn:hover .slider2:before,
.btn:hover .slider2:after{
  left: 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console