123

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .periodic-table
  .element.-n1.-reactive-nonmetal 1 #[br] H
  .element.-n2.-noble-gas 2 #[br] He
  .element.-n3.-alkali-metal 3 #[br] Li
  .element.-n4.-alkaline-earth-metal 4 #[br] Be
  .element.-n5.-metalloid 5 #[br] B
  .element.-n6.-reactive-nonmetal 6 #[br] C
  .element.-n7.-reactive-nonmetal 7 #[br] N
  .element.-n8.-reactive-nonmetal 8 #[br] O
  .element.-n9.-reactive-nonmetal 9 #[br] F
  .element.-n10.-noble-gas 10 #[br] Ne
  .element.-n11.-alkali-metal 11 #[br] Na
  .element.-n12.-alkaline-earth-metal 12 #[br] Mg
  .element.-n13.-post-transition-metal 13 #[br] Ai
  .element.-n14.-metalloid 14 #[br] Si
  .element.-n15.-reactive-nonmetal 15 #[br] P
  .element.-n16.-reactive-nonmetal 16 #[br] S
  .element.-n17.-reactive-nonmetal 17 #[br] Cl
  .element.-n18.-noble-gas 18 #[br] Ar
  .element.-n19.-alkali-metal 19 #[br] K
  .element.-n20.-alkaline-earth-metal 20 #[br] Ca
  .element.-n21.-transition-metal 21 #[br] Sc
  .element.-n22.-transition-metal 22 #[br] Ti
  .element.-n23.-transition-metal 23 #[br] V
  .element.-n24.-transition-metal 24 #[br] Cr
  .element.-n25.-transition-metal 25 #[br] Mn
  .element.-n26.-transition-metal 26 #[br] Fe
  .element.-n27.-transition-metal 27 #[br] Co
  .element.-n28.-transition-metal 28 #[br] Ni
  .element.-n29.-transition-metal 29 #[br] Cu
  .element.-n30.-post-transition-metal 30 #[br] Zn
  .element.-n31.-post-transition-metal 31 #[br] Ga
  .element.-n32.-metalloid 32 #[br] Ge
  .element.-n33.-metalloid 33 #[br] As
  .element.-n34.-reactive-nonmetal 34 #[br] Se
  .element.-n35.-reactive-nonmetal 35 #[br] Br
  .element.-n36.-noble-gas 36 #[br] Kr
  .element.-n37.-alkali-metal 37 #[br] Rb
  .element.-n38.-alkaline-earth-metal 38 #[br] Sr
  .element.-n39.-transition-metal 39 #[br] Y
  .element.-n40.-transition-metal 40 #[br] Zr
  .element.-n41.-transition-metal 41 #[br] Nb
  .element.-n42.-transition-metal 42 #[br] Mo
  .element.-n43.-transition-metal 43#[br] Tc
  .element.-n44.-transition-metal 44 #[br] Ru
  .element.-n45.-transition-metal 45 #[br] Rh
  .element.-n46.-transition-metal 46 #[br] Pd
  .element.-n47.-transition-metal 47 #[br] Ag
  .element.-n48.-post-transition-metal 48 #[br] Li
  .element.-n49.-post-transition-metal 49 #[br] In
  .element.-n50.-post-transition-metal 50 #[br] Sn
  .element.-n51.-metalloid 51 #[br] Sb
  .element.-n52.-metalloid 52 #[br] Te
  .element.-n53.-reactive-nonmetal 53 #[br] I
  .element.-n54.-noble-gas 54 #[br] Xe
  .element.-n55.-alkali-metal 55 #[br] Cs
  .element.-n56.-alkaline-earth-metal 56 #[br] Ba
  .element.-n57.-lanthanide 57 #[br] La
  .element.-n58.-lanthanide 58 #[br] Ce
  .element.-n59.-lanthanide 59 #[br] Pr
  .element.-n60.-lanthanide 60 #[br] Nd
  .element.-n61.-lanthanide 61 #[br] Pm
  .element.-n62.-lanthanide 62 #[br] Sm
  .element.-n63.-lanthanide 63 #[br] Eu
  .element.-n64.-lanthanide 64 #[br] Gd
  .element.-n65.-lanthanide 65 #[br] Tb
  .element.-n66.-lanthanide 66 #[br] Dy
  .element.-n67.-lanthanide 67 #[br] Ho
  .element.-n68.-lanthanide 68 #[br] Er
  .element.-n69.-lanthanide 69 #[br] Tm
  .element.-n70.-lanthanide 70 #[br] Yb
  .element.-n71.-lanthanide 71 #[br] Lu
  .element.-n72.-transition-metal 72 #[br] Hf
  .element.-n73.-transition-metal 73 #[br] Ta
  .element.-n74.-transition-metal 74 #[br] W
  .element.-n75.-transition-metal 75 #[br] Re
  .element.-n76.-transition-metal 76 #[br] Os
  .element.-n77.-transition-metal 77 #[br] Ir
  .element.-n78.-transition-metal 78 #[br] Pt
  .element.-n79.-transition-metal 79 #[br] Au
  .element.-n80.-post-transition-metal 80 #[br] Hg
  .element.-n81.-post-transition-metal 81 #[br] Tl
  .element.-n82.-post-transition-metal 82 #[br] Pb
  .element.-n83.-post-transition-metal 83 #[br] Bi
  .element.-n84.-post-transition-metal 84 #[br] Po
  .element.-n85.-metalloid 85 #[br] At
  .element.-n86.-noble-gas 86 #[br] Rn
  .element.-n87.-alkali-metal 87 #[br] Fr
  .element.-n88.-alkaline-earth-metal 88 #[br] Ra
  .element.-n89.-actinide 89 #[br] Ac
  .element.-n90.-actinide 90 #[br] Th
  .element.-n91.-actinide 91 #[br] Pa
  .element.-n92.-actinide 92 #[br] U
  .element.-n93.-actinide 93 #[br] Np
  .element.-n94.-actinide 94 #[br] Pu
  .element.-n95.-actinide 95 #[br] Am
  .element.-n96.-actinide 96 #[br] Cm
  .element.-n97.-actinide 97 #[br] Bk
  .element.-n98.-actinide 98 #[br] Cf
  .element.-n99.-actinide 99 #[br] Es
  .element.-n100.-actinide 100 #[br] Fm
  .element.-n101.-actinide 101 #[br] Md
  .element.-n102.-actinide 102 #[br] No
  .element.-n103.-actinide 103 #[br] Lr
  .element.-n104.-transition-metal 104 #[br] Rf
  .element.-n105.-transition-metal 105#[br] Db
  .element.-n106.-transition-metal 106 #[br] Sg
  .element.-n107.-transition-metal 107 #[br] Bh
  .element.-n108.-transition-metal 108 #[br] Hs
  .element.-n109.-unknown-chemical-properties 109 #[br] Mt
  .element.-n110.-unknown-chemical-properties 110 #[br] Ds
  .element.-n111.-unknown-chemical-properties 111 #[br] Rg
  .element.-n112.-post-transition-metal 112 #[br] Cn
  .element.-n113.-unknown-chemical-properties 113 #[br] Nh
  .element.-n114.-unknown-chemical-properties 114 #[br] Fl
  .element.-n115.-unknown-chemical-properties 115 #[br] Mc
  .element.-n116.-unknown-chemical-properties 116 #[br] Lv
  .element.-n117.-unknown-chemical-properties 117 #[br] Ts
  .element.-n118.-unknown-chemical-properties 118 #[br] Og

            
          
!
            
              @mixin makeElement($number, $x, $y) {
  &.-n#{$number} {
    grid-column: #{$x}/#{$x+1};
    grid-row: #{$y}/#{$y+1};
  }
}

@mixin makeElements($fromElement, $fromX, $toX, $y) {
  @for $x from $fromX through $toX {
      $elem: $fromElement + ($x - $fromX);
      @include makeElement($elem, $x, $y);
  }
}

@mixin makeElementsTable() {
  // Line 1
  @include makeElement(1,1,1);
  @include makeElement(2,18,1);

  // Line 2
  @include makeElements(3,1,2,2);
  @include makeElements(5,13,18,2);

  // Line 3
  @include makeElements(11,1,2,3);
  @include makeElements(13,13,18,3);

  // Line 4
  @include makeElements(19,1,18,4);

  // Line 5
  @include makeElements(37,1,18,5);

  // Line 6
  @include makeElements(55,1,3,6);
  @include makeElements(72,4,18,6);

  // Line 7
  @include makeElements(87,1,3,7);
  @include makeElements(104,4,18,7);

  // Line 9
  @include makeElements(58,4,17,9);

  // Line 10
  @include makeElements(90,4,17,10);
}

.periodic-table {
  display: grid;
  grid-template-columns: repeat(18, 1fr [col-start]);
  grid-template-rows: repeat(10, 90px [col-start]);

  .element {
    @include makeElementsTable();

    border: 2px solid #fff;
    text-align: center;
    padding-top: 30px;
    font-family: arial;
    font-weight: bold;

    &.-reactive-nonmetal {
      background: #fff777;
    }

    &.-metalloid {
      background: #8a9bff;
    }

    &.-noble-gas {
      background: #8cfffe;
    }

    &.-alkali-metal {
      background: #fb6767;
    }

    &.-alkaline-earth-metal {
      background: #ffb38a;
    }

    &.-post-transition-metal {
      background: #b59ddd;
    }

    &.-unknown-chemical-properties {
      background: #bbb;
    }

    &.-lanthanide {
      background: #85f9ae;
    }

    &.-actinide {
      background: #bd9179;
    }

    &.-transition-metal {
      background: #ffb9f4;
    }
  }
}

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console