Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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>
  <div id="Info-box">
    <table>
      <tr id="atomic_number"></tr>    <!--atomic number-->
      <tr id="big_letter"></tr>       <!--big letter-->
      <tr id="elemental_name"></tr>   <!--Elemental Name-->
      <tr id="atomic_weight"></tr>    <!--Atomic weight-->
    </table>
  </div>
  <table id="Periodic-Table">
    <tr class="Period" id="row1">
      <td class="Element Diatomic-nonmetal" id="Hydrogen">H</td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td class="Element Noble-Gas" id="Helium">He</td>
    </tr>
    
    <tr class="Period" id="row2">
      <td class="Element Alkali-metal" id="Lithium">Li</td>
      <td class="Element Alkali-earth-metal" id="Beryllium">Be</td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td class="Element Metalloid" id="Boron">B</td>
      <td class="Element Polyatomic-nonmetal" id="Carbon">C</td>
      <td class="Element Diatomic-nonmetal" id="Nitrogen">N</td>
      <td class="Element Diatomic-nonmetal" id="Oxygen">O</td>
      <td class="Element Diatomic-nonmetal" id="Flourine">F</td>
      <td class="Element Noble-Gas" id="Neon">Ne</td>
    </tr>
    <tr class="Period" id="row3">
      <td class="Element Alkali-metal" id="Sodum">Na</td>
      <td class="Element Alkali-earth-metal" id="Magnesium">Mg</td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td class="Element Other-metal" id="Aluminium">Al</td>
      <td class="Element Metalloid" id="Silicon">Si</td>
      <td class="Element Polyatomic-nonmetal" id="Phosphorus">P</td>
      <td class="Element Polyatomic-nonmetal" id="Sulfur">S</td>
      <td class="Element Diatomic-nonmetal" id="Chlorine">Cl</td>
      <td class="Element Noble-Gas" id="Argon">Ar</td>
    </tr>
    <tr class="Period" id="row4">
      <td class="Element Alkali-metal" id="Potassium">K</td>
      <td class="Element Alkali-earth-metal" id="Calcium">Ca</td>
      <td class="Element Transition-metal" id="Scandium">Sc</td>
      <td class="Element Transition-metal" id="Titanium">Ti</td>
      <td class="Element Transition-metal" id="Vanadium">V</td>
      <td class="Element Transition-metal" id="Chromium">Cr</td>
      <td class="Element Transition-metal" id="Manganese">Mn</td>
      <td class="Element Transition-metal" id="Iron">Fe</td>
      <td class="Element Transition-metal" id="Cobalt">Co</td>
      <td class="Element Transition-metal" id="Nickel">Ni</td>
      <td class="Element Transition-metal" id="Copper">Cu</td>
      <td class="Element Transition-metal" id="Zinc">Zn</td>
      <td class="Element Other-metal" id="Gallium">Ga</td>
      <td class="Element Metalloid" id="Germanium">Ge</td>
      <td class="Element Metalloid" id="Arsenic">As</td>
      <td class="Element Polyatomic-nonmetal" id="Selenium">Se</td>
      <td class="Element Diatomic-nonmetal" id="Bromine">Br</td>
      <td class="Element Noble-Gas" id="Krypton">Kr</td>
    </tr>
    <tr class="Period" id="row5">
      <td class="Element Alkali-metal" id="Rubidium">Rb</td>
      <td class="Element Alkali-earth-metal" id="Strontium">Sr</td>
      <td class="Element Transition-metal" id="Yittrium">Y</td>
      <td class="Element Transition-metal" id="Zirconium">Zr</td>
      <td class="Element Transition-metal" id="Niobium">Nb</td>
      <td class="Element Transition-metal" id="Molybdenum">Mo</td>
      <td class="Element Transition-metal" id="Technetium">Tc</td>
      <td class="Element Transition-metal" id="Ruthenium">Ru</td>
      <td class="Element Transition-metal" id="Rhodium">Rh</td>
      <td class="Element Transition-metal" id="Palladium">Pd</td>
      <td class="Element Transition-metal" id="Silver">Ag</td>
      <td class="Element Transition-metal" id="Cadmium">Cd</td>
      <td class="Element Other-metal" id="Indium">In</td>
      <td class="Element Other-metal" id="Tin">Sn</td>
      <td class="Element Metalloid" id="Antimony">Sb</td>
      <td class="Element Metalloid" id="Tellurium">Te</td>
      <td class="Element Diatomic-nonmetal" id="Iodine">I</td>
      <td class="Element Noble-Gas" id="Xenon">Xe</td>
    </tr>
    <tr class="Period" id="row6">
      <td class="Element Alkali-metal" id="Caesium">Cs</td>
      <td class="Element Alkali-earth-metal" id="Barium">Ba</td>
      <td class="Indicator Top">*</td>
      <td class="Element Transition-metal" id="Hafnium">Hf</td>
      <td class="Element Transition-metal" id="Tantalum">Ta</td>
      <td class="Element Transition-metal" id="Tungsten">W</td>
      <td class="Element Transition-metal" id="Rhenium">Re</td>
      <td class="Element Transition-metal" id="Osmum">Os</td>
      <td class="Element Transition-metal" id="Iridium">Ir</td>
      <td class="Element Transition-metal" id="Platinum">Pt</td>
      <td class="Element Transition-metal" id="Gold">Au</td>
      <td class="Element Transition-metal" id="Mercury">Hg</td>
      <td class="Element Other-metal" id="Thallium">Tl</td>
      <td class="Element Other-metal" id="Lead">Pb</td>
      <td class="Element Other-metal" id="Bisumth">Bi</td>
      <td class="Element Other-metal" id="Polonium">Po</td>
      <td class="Element Metalloid" id="Astantine">At</td>
      <td class="Element Noble-Gas" id="Radon">Rn</td>
    </tr>
    <tr class="Period" id="row7">
      <td class="Element Alkali-metal" id="Francium">Fr</td>
      <td class="Element Alkali-earth-metal" id="Radium">Ra</td>
      <td class="Indicator Top">**</td>
      <td class="Element Transition-metal" id="Rutherfordium">Rf</td>
      <td class="Element Transition-metal" id="Dubnium">Db</td>
      <td class="Element Transition-metal" id="Seaborgium">Sg</td>
      <td class="Element Transition-metal" id="Bohrium">Bh</td>
      <td class="Element Transition-metal" id="Hassium">Hs</td>
      <td class="Element Unknown" id="Meltnerium">Mt</td>
      <td class="Element Unknown" id="Darmstadtium">Ds</td>
      <td class="Element Unknown" id="Roentgenium">Rg</td>
      <td class="Element Transition-metal" id="Copernicium">Cn</td>
      <td class="Element Unknown" id="Ununtium">Uut</td>
      <td class="Element Unknown" id="Flerovium">Fl</td>
      <td class="Element Unknown" id="Ununpentium">Uup</td>
      <td class="Element Unknown" id="Livermorium">Lv</td>
      <td class="Element Unknown" id="Ununseptium">Uus</td>
      <td class="Element Unknown" id="Ununoctium">Uuo</td>
    </tr>
    <tr class="Period" id="row8">
      <td></td>
      <td class="Indicator Bot">*</td>
      <td class="Element Lanthanide" id="Lanthanum">La</td>
      <td class="Element Lanthanide" id="Cerium">Ce</td>
      <td class="Element Lanthanide" id="Praseodymium">Pr</td>
      <td class="Element Lanthanide" id="Neodymium">Nd</td>
      <td class="Element Lanthanide" id="Samarium">Sm</td>
      <td class="Element Lanthanide" id="Europium">Eu</td>
      <td class="Element Lanthanide" id="Gadolinium">Gd</td>
      <td class="Element Lanthanide" id="Terbium">Tb</td>
      <td class="Element Lanthanide" id="Dysprosium">Dy</td>
      <td class="Element Lanthanide" id="Holmium">Ho</td>
      <td class="Element Lanthanide" id="Erbium">Er</td>
      <td class="Element Lanthanide" id="Thalium">Tm</td>
      <td class="Element Lanthanide" id="Ytterbium">Yb</td>
      <td class="Element Lanthanide" id="Lutetium">Lu</td>
      <td></td>
    </tr>
    <tr class="Period" id="row9">
      <td></td>
      <td class="Indicator Bot">**</td>
      <td class="Element Actinide" id="Actinium">Ac</td>
      <td class="Element Actinide" id="Thorium">Th</td>
      <td class="Element Actinide" id="Protactinium">Pa</td>
      <td class="Element Actinide" id="Neptunium">U</td>
      <td class="Element Actinide" id="Plutonium">Pu</td>
      <td class="Element Actinide" id="Americium">Am</td>
      <td class="Element Actinide" id="Curium">Cm</td>
      <td class="Element Actinide" id="Berkelium">Bk</td>
      <td class="Element Actinide" id="Californium">Cf</td>
      <td class="Element Actinide" id="Einsteinium">Es</td>
      <td class="Element Actinide" id="Fermium">Fm</td>
      <td class="Element Actinide" id="Mendelevium">Md</td>
      <td class="Element Actinide" id="Nobefium">No</td>
      <td class="Element Actinide" id="Lawrencium">Lr</td>
      <td></td>
    </tr>
  </table>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

html{
  height:100%;
  width:100%;
  background-image: url(https://i.imgur.com/4PRuuU8.jpg);
  background-size: auto;
  background-repeat: no-repeat;
}

#Periodic-Table{
  font-family: 'Montserrat', 'sans-serif';
  position: relative;
  left:37em;
  text-align:center;
}

#Info-box{
  border-style:solid;
  position:absolute;
  left:20em;
  height:250px;
  width:250px;
  color: white;  
}

.Element{
  border-style:solid;
  border-width:2px;
  padding:5px;
  transition-property:opacity;
  color: white;
}
.Element:hover{
   opacity:.45;  
}

.info-wrapper{
  background-color:rgba(150,150,150,.3);
}

.Noble-Gas{
  background-color:rgba(0,50,250,0.3);
}

.Diatomic-nonmetal{
  background-color:rgba(190,100,0,0.45);
}

 .Metalloid{
   background-color:rgba(150,150,60,0.5);
 }

 .Polyatomic-nonmetal{
   background-color:rgba(0,150,0,.3);
 }

.Other-metal{
  background-color:rgba(150,150,150,.57);
}

.Transition-metal{
  background-color:rgba(150,0,0,.3);
}

.Alkali-metal{
  background-color:rgba(200,0,0,0.6); 
}

.Alkali-earth-metal{
  background-color:rgba(180,120,0,.3);
}

.Lanthanide{
  background-color:rgba(100,0,200,.3);
}

.Actinide{
  background-color:rgba(160,0,120,.3);
  
}

.Unknown{
  background-color:rgba(150,150,0,.2);
}
              
            
!

JS

              
                $('.Element').mouseover(function() {
  var background;
  var ID = this.id;
  var Letter = this.innerHTML;
  var Class = this.className;
  $('#elemental_name').text(ID);
  $('#big_letter').text(Letter);
  console.log(Class);
  switch (Class) {
    case 'Element Noble-gas':
      background = "rgba(0,50,250,0.3)";
      break;
    case 'Element Metalloid':
      background = "rgba(150,150,60,0.5)";
      $('#info-box').css('background-color', background);
      break;
    case 'Element Diatomic-nonmetal':
      background = "rgba(190,100,0,0.45);";
      break;
    case 'Element Polyatomic-nonmetal':
      background = "rgba(0,150,0,.3);";
      break;
    case 'Element Other-metal':
      background = "rgba(150,150,150,.57);";
      break;
    case 'Element Transition-metal':
      background = "rgba(150,0,0,.3);";
      break;
    case 'Element Alkali-metal':
      background = "rgba(200,0,0,.6);";
      break;
    case 'Element Alkali-earth-metal':
      background = "rgba(180,120,0,.3);";
      break;
    case 'Element Lanthanide':
      background = "rgba(100,0,200,.3);";
      break;
    case 'Element Actinide':
      background = "rgba(160,0,120,.3);";
      break;
    case 'Element Unknown':
      background = "rgba(150,150,0,.2);";
      break;
    default:
      background = "rgba(250,0,0,.1);";
      break;
  }
});

$('.Element').mouseout(function() {
  $(".info-wrapper").remove();
});
      
              
            
!
999px

Console