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='container'>
  <h1>
    Buttons
  </h1>
  <p>
    Random selection of button styles. May change over time as I get alot of stupid ideas. Feel free to follow me on  <a href="https://twitter.com/simonbusborg" target="_blank" class="twitter">twitter</a>
  </p>
  <div class="button-container">
    <div class='button -regular center'>Let's start</div>
    
    <div class='button -dark center'>Touch me</div>
    
    <div class='button -green center'>Just like that</div>
    
    <div class='button -blue center'>And that, oh, yeah</div>
        
    <div class='button -salmon center'>Now that I like</div>
    
    <div class='button -sun center'>God, that's so nice</div>
    
    <div class='button -alge center'>Now lower down</div>
    
    <div class='button -flower center'>Where the figs lie</div>
    
  </div>
</div>
            
          
!
            
              // colors
:root {
  --color-dark:  #161616;
  --color-ocean:  #416dea;
  --color-grass: #3dd28d;
  --color-snow: #FFFFFF;
  --color-salmon: #F32C52;
  --color-sun: #feee7d;
  --color-alge: #7999a9;
  --color-flower: #353866;
  --color-smoke: #e4e4e4;

  --font-face: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}


// reset
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}



// body styles
body {
  display: flex;

  box-sizing: border-box;
  min-height: 100vh;

  background: whitesmoke;
  font-family: var(--font-face);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;

  justify-content: center;
  align-items: center;
  
  @media (min-width: 992px) {
    border-width: 30px;
  }
}

body.linked {
  
  .button, h1 {
    opacity: .3;
    transition: opacity 300ms linear;
  }
  
  p {
    color: var(--color-smoke);
    transition: color 300ms linear;
  }
}




// text styles
h1 {
  text-align: center;
  
  transition: opacity 300ms linear;

  color: var(--color-dark);

  font-family: var(--font-face);
  font-size: 32px;
  font-weight: 700;
  
  span {
    font-weight: 400;
  }
}

p {
  max-width: 460px;
  margin: 0 auto;

  transition: color 300ms linear;
  text-align: center; 

  color: var(--color-dark);

  font-weight: 400;
  line-height: 1.5;
}

a, a:visited {
  text-decoration: none;

  color: var(--color-ocean);

  font-weight: 500;
  
  &:hover {
    text-decoration: underline;
    color:var(--color-ocean);
  }
}




// container styles
.container {  
  display: flex;
  flex-direction: column;

  width: 100%;
  padding: 20px;
}

.button-container {
    display: flex;

    margin: 60px auto;

    flex-wrap: wrap;
    justify-content: center;
}




// button styles
.button {
  display: flex;
  overflow: hidden;

  margin: 10px;
  padding: 12px 12px;

  cursor: pointer;
  user-select: none;
  transition: all 150ms linear;
  text-align: center;
  white-space: nowrap;
  text-decoration: none !important;
  text-transform: none;
  text-transform: capitalize;

  color: #fff;
  border: 0 none;
  border-radius: 4px;

  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;

  -webkit-appearance: none;
  -moz-appearance:    none;
  appearance:         none;
 
  justify-content: center;
  align-items: center;
  flex: 0 0 160px;
  
  box-shadow: 2px 5px 10px var(--color-smoke);

  &:hover {
    transition: all 150ms linear;

    opacity: .85;
  }
  
  &:active {
    transition: all 150ms linear;
    opacity: .75;
  }
  
  &:focus {
    outline: 1px dotted #959595;
    outline-offset: -4px;
  }
}

.button.-regular {
  color: #202129;
  background-color: #f2f2f2;
  
  &:hover {
    color: #202129;
    background-color: #e1e2e2;
    opacity: 1;
  }
  
  &:active {
    background-color: #d5d6d6;
    opacity: 1;
  }
}

.button.-dark {
  color: var(--color-snow);
  background: var(--color-dark);
  
   &:focus {
    outline: 1px dotted white;
    outline-offset: -4px;
  }
}
  
.button.-green {
  color: var(--color-snow);
  background: var(--color-grass);
}

.button.-blue {
  color: var(--color-snow);
  background: var(--color-ocean);
}

.button.-salmon {
  color: var(--color-snow);
  background: var(--color-salmon);
}

.button.-sun {
  color: #f15c5c;
  background: var(--color-sun);
}

.button.-alge {
  color: #e7ff20;
  background: var(--color-alge);
}

.button.-flower {
  color: #FE8CDF;
  background: var(--color-flower);
}
            
          
!
            
              const	body = document.querySelector('body')
const twitter = document.querySelector('.twitter')

twitter.addEventListener("mouseover", function () {
    body.classList.add('linked')
},false)

twitter.addEventListener("mouseout", function () {
    body.classList.remove('linked')
}, false)
            
          
!
999px
Loading ..................

Console