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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

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.

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

<div class = 'container'>
  <div class = 'customise'>
    <h2 class = 'customise__head' >Customise your new credit card.</h2>
  </div>
  <div class = 'card-contain'>
    <div class = 'logo-contain'>
    <img class = 'visa-logo' src = https://upload.wikimedia.org/wikipedia/commons/5/5e/Visa_Inc._logo.svg>
    </div>
    <h2 class = 'card-number'>0123 4567 8910 1112</h2>
    
    <div class = 'card-contain__info'>
    <h3 class = 'card-holder-name'>James Schofield</h3>
    </div>
  </div>
  
  <div class = 'color-selector-container'>
    
    <div class = 'color-option color-option--is-gold'>
    </div>
    <div class = 'color-option color-option--is-silver'>
    </div>
    <div class = 'color-option color-option--is-black'>
    </div>
    
    
  </div>
</div>
            
          
!
            
              body {
  overflow: hidden;
  font-family: 'Karla', sans-serif;
  background: linear-gradient(45deg, #005C97 0%, #2a5298 100%);
}

a[href^=tel] {
  color: white;
  text-decoration: none;
}


.container {
  min-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h2.customise__head {
  color: white;
}

.card-contain {
  display: flex;
  height: 200px;
  width: 350px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(45deg, #18181A 0%, #2A2936 100%);
  box-shadow: 0px 0px 15px 1px rgba(0,0,0,0.10);
}

div.logo-contain {
  align-self: flex-end;
  padding-right: 30px;
}

img.visa-logo {
  width: 50px;
  height: 30px;
  background-color: white;
  padding-right: 3px;
  border-radius: 6px;
}

.card-contain__info {
  width: 100%;
  display: flex;
  flex-direction: row;
}

h2.card-number {
  color: white;
  font-size: 18px;
  letter-spacing: 0.3em;
  text-shadow: 0px 1px 1px rgba(150, 150, 150, 1);
}

h3.card-holder-name {
  color: white;
  font-size: 16px;
  letter-spacing: 1px;
  align-self: flex-start;
  margin-left: 13%;
  text-shadow: 0px 1px 1px rgba(150, 150, 150, 1);
}

.color-selector-container {
  display: flex;
  flex-direction: row;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #ffc259;
  margin: 10px;
  box-shadow: inset 7px 6px 12px -2px rgba(0,0,0,0.20);
  cursor: pointer;
}

.color-option--is-gold {
  background: linear-gradient(30deg, #FFD61F 0%, #B88804 100%);
}

.color-option--is-silver {
  background: linear-gradient(45deg, #EDF3FF 0%, #A7ABB8 100%);
}

.color-option--is-black {
  background: linear-gradient(45deg, #18181A 0%, #2A2936 100%);
}
            
          
!
            
              document.querySelector('.color-option--is-gold').addEventListener('click', function(){

var card = document.querySelector('.card-contain');
  
  card.classList.remove('color-option--is-silver');
  card.classList.remove('color-option--is-black');
  card.classList.add('color-option--is-gold');
});

//Change Silver//
document.querySelector('.color-option--is-silver').addEventListener('click', function(){

var card = document.querySelector('.card-contain');
  
  card.classList.remove('color-option--is-gold');
  card.classList.remove('color-option--is-black');
  card.classList.add('color-option--is-silver');
});

//Change Black//
document.querySelector('.color-option--is-black').addEventListener('click', function(){

var card = document.querySelector('.card-contain');
  
  card.classList.remove('color-option--is-gold');
  card.classList.remove('color-option--is-silver');
  card.classList.add('color-option--is-black');
});          

            
          
!
999px
Loading ..................

Console