cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="maxcontainer">
  <div class="thebutton progressive">
    <div class="box buttonbox">
      <div class="johnny">
        Button
      </div>
    </div>
    <div class="desccontainer">
      <a class="desc left" target="_blank" href="http://uibuttons.com/">uibuttons</a>
      <a class="desc right" target="_blank" href="#">Code</a>
    </div>
  </div>

  <div class="thebutton info">
    <div class="boxinformation">
      <h1>Johnny's 4 Borders</h1> 
      <p>A clever solution by my super smart developer friend, <a target="_blank" href="https://twitter.com/johnny5th">Johnny</a>.</p> <p>Hover to reveal all four borders. Two of the borders are pseudo elements and the other two are made with a gradient. But how? ;)</p> 
 
    </div>

  </div>

</div>
            
          
!
            
              /*** Container ****/

.box.buttonbox {
  background: #efdfbb;
}


/*** Button Code ****/

.johnny {
  margin: auto;
  font-size: .75rem;
  font-family: 'Roboto', sans-serif;
  text-align: center;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1px;
  position: relative;
  display: block;
  width: 15.33333em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #fff;
  border: 2px solid #3f231c;
  box-sizing: border-box;
  text-transform: uppercase;
  padding: .66667em 1.66667em 1em;
  cursor: pointer;
  margin-bottom: 20px;
  width: 100px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  margin: auto;
  text-align: center;
}

.johnny:before {
  position: absolute;
  content: "";
  border-right: 2px solid #3f231c;
  width: 0;
  height: calc(100% - 3px);
  right: 3px;
  bottom: 4px;
}

.johnny:after,
button:after {
  border-bottom: 2px solid #3f231c;
  width: calc(100% - 3px);
  height: 0;
  left: 0;
  bottom: 3px;
  position: absolute;
  content: "";
}

.johnny:hover {
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 3px, #3f231c 3px, #3f231c 5px, rgba(0, 0, 0, 0) 5px, rgba(0, 0, 0, 0) calc(100% - 5px), #3f231c calc(100% - 5px), #3f231c calc(100% - 3px), rgba(0, 0, 0, 0) calc(100% - 3px)), linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 3px, #3f231c 3px, #3f231c 5px, rgba(0, 0, 0, 0) 5px, rgba(0, 0, 0, 0) calc(100% - 5px), #3f231c calc(100% - 5px), #3f231c calc(100% - 3px), rgba(0, 0, 0, 0) calc(100% - 3px));
  padding: .83333em 1.66667em;
}


/*** Foundation Code ****/

body {
  background-color: #f4f4f4;
  font-family: "Roboto", sans-serif;
}

a {
  text-decoration: none;
}

.maxcontainer {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  overflow: auto;
}

@media screen and (min-width: 750px) {
  .maxcontainer {
    padding: 0;
  }
}

.thebutton {
  float: left;
  width: 95%;
  margin: 2.5% 2.5% 0 2.5%;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  -webkit-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.1);
  box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.1);
}

@media screen and (min-width: 750px) {
  .thebutton {
    width: 47.5%;
    margin: 2.5% 1.25% 0 1.25%;
  }
}

.box {
  overflow: hidden;
  width: 100%;
  margin: auto;
  height: 0;
  position: relative;
  padding-bottom: 70%;
}

@media screen and (min-width: 650px) {
  .box {}
}

.desccontainer {
  position: relative;
  width: 100%;
  background: rgba(255, 255, 255, 1);
  float: left;
}

.desc {
  float: left;
  font-size: 11px;
  font-weight: 900;
  padding: 10px 0;
  letter-spacing: .25px;
  text-align: center;
  color: #bcbcbc;
  opacity: 1;
  z-index: 2000;
  background: rgba(255, 255, 255, 1);
  transition: all .1s ease-in-out;
  -o-transition: all .1s ease-in-out;
  -moz-transition: all .1s ease-in-out;
  -webkit-transition: all .1s ease-in-out;
}

.desc.left {
  width: 49.7%;
  margin-right: .3%;
  -webkit-box-shadow: 1px 0px 0px 0px rgba(235, 235, 235, 1);
  -moz-box-shadow: 1px 0px 0px 0px rgba(235, 235, 235, 1);
  box-shadow: 1px 0px 0px 0px rgba(235, 235, 235, 1);
}

.desc.right {
  width: 50%;
}

.boxinformation {
  background: none;
  color: #000;
  font-weight: 200;
  width: 100%;
  margin: auto;
  position: relative;
}

.boxinformation a {
  color: #000;
  opacity: .4;
  font-weight: bold;
  text-decoration: underline;
}

.boxinformation a:hover {
  opacity: 1;
}

.thebutton.info {
  -webkit-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0);
  -moz-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0);
  box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0);
}
            
          
!
999px
Loading ..................

Console