{
CF
}
Code
Fronts
Back to CSS Grid Layouts
Periodic Table
Pure CSS
Edit any tab — preview updates live
CSS
HTML
Reset
Copy
.gl-pt { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(3, 36px); gap: 3px; width: 320px; font-family: system-ui, sans-serif; color: #fff; } .gl-pt-c { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 3px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,0.3); line-height: 1; } .gl-pt-c b { font-size: 7.5px; font-weight: 500; margin-bottom: 1px; opacity: 0.8; } .gl-pt-h { background: linear-gradient(135deg, #2eb88a, #3de8aa); } .gl-pt-noble { background: linear-gradient(135deg, #ff6c8a, #ff9a76); } .gl-pt-alk { background: linear-gradient(135deg, #f5a84a, #ffd479); } .gl-pt-alke { background: linear-gradient(135deg, #ffd479, #f5a84a); color: #1a1a2e; text-shadow: none; } .gl-pt-met { background: linear-gradient(135deg, #7c6cff, #a78bfa); } .gl-pt-non { background: linear-gradient(135deg, #3de8f5, #5aa0e0); } .gl-pt-hal { background: linear-gradient(135deg, #a78bfa, #cbb8ff); color: #1a1a2e; text-shadow: none; }
<div class="gl-pt"> <div class="gl-pt-c gl-pt-h" style="grid-area:1/1"><b>1</b>H</div> <div class="gl-pt-c gl-pt-noble" style="grid-area:1/9"><b>2</b>He</div> <div class="gl-pt-c gl-pt-alk" style="grid-area:2/1"><b>3</b>Li</div> <div class="gl-pt-c gl-pt-alke" style="grid-area:2/2"><b>4</b>Be</div> <div class="gl-pt-c gl-pt-met" style="grid-area:2/4"><b>5</b>B</div> <div class="gl-pt-c gl-pt-non" style="grid-area:2/5"><b>6</b>C</div> <div class="gl-pt-c gl-pt-non" style="grid-area:2/6"><b>7</b>N</div> <div class="gl-pt-c gl-pt-non" style="grid-area:2/7"><b>8</b>O</div> <div class="gl-pt-c gl-pt-hal" style="grid-area:2/8"><b>9</b>F</div> <div class="gl-pt-c gl-pt-noble" style="grid-area:2/9"><b>10</b>Ne</div> <div class="gl-pt-c gl-pt-alk" style="grid-area:3/1"><b>11</b>Na</div> <div class="gl-pt-c gl-pt-alke" style="grid-area:3/2"><b>12</b>Mg</div> <div class="gl-pt-c gl-pt-met" style="grid-area:3/4"><b>13</b>Al</div> <div class="gl-pt-c gl-pt-met" style="grid-area:3/5"><b>14</b>Si</div> <div class="gl-pt-c gl-pt-non" style="grid-area:3/6"><b>15</b>P</div> <div class="gl-pt-c gl-pt-non" style="grid-area:3/7"><b>16</b>S</div> <div class="gl-pt-c gl-pt-hal" style="grid-area:3/8"><b>17</b>Cl</div> <div class="gl-pt-c gl-pt-noble" style="grid-area:3/9"><b>18</b>Ar</div> </div>
Live preview
Ready