Bản mẫu:Bảng tuần hoàn các nguyên tố hóa học/style.css

Tủ sách mở Wikibooks
body {
  font-family: Phenomena, script;
  margin: 5vw;
  background: #111;
  color: #000;
  counter-reset: element;
}
.periodic-table {
  display: grid;
  grid-column-gap: .5vw;
  grid-row-gap: .5vw;
  padding-left: 0;
}
.periodic-table > li {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  height: 4.5vw;
  border-radius: 3px;
  background: rgb(91, 194, 234);
  font-weight: bold;
}
.periodic-table > li:before {
  position: absolute;
  bottom: 5px;
  left: 6px;
  font-size: .9vw;
  font-weight: lighter;
}
.periodic-table > li abbr {
  font-size: 2.5vw;
}
#helium {
  grid-column-start: 18;
}
#boron, #aluminium {
  grid-column-start: 13;
}
#cerium, #thorium {
  grid-column-start: 4;
}
.periodic-table > li:nth-child(n+58):nth-last-child(n+48) {
  grid-row-start: 8;
}
.periodic-table > li:nth-child(n+90):nth-last-child(n+16) {
  grid-row-start: 9;
}
.periodic-table:before {
  display: block;
  content: '';
  grid-row: 8 / 10;
  grid-column: 1 / 4;
}
.periodic-table .noble-gas {
  background: rgb(234, 218, 36);
  display: inline-block;
  position: relative;
  transform: translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
}
.periodic-table .noble-gas:active {
	position: relative;
}
.periodic-table .diatomic-nonmetal {
  background: rgb(234, 179, 127);
}
.periodic-table .alkali {
  background: hsl(326, 52%, 84%);
}
.periodic-table .hydrogen {
  background: rgb(163, 199, 210);  
}
.periodic-table .alkaline {
  background: hsl(120, 52%, 84%);
}
.periodic-table .unknown {
  background: hsl(210, 2%, 73%);
}
.periodic-table .lanthanide {
  background: hsl(183, 54%, 84%);
}
.periodic-table .actinide {
  background: hsl(82, 60%, 56%);  
}
.periodic-table .metalloid {
  background: hsl(142, 60%, 56%);  
}
.periodic-table .polyatomic-non-metal {
  background: hsl(358, 60%, 56%);  
}

@media all and (max-width: 1100px) {
  #helium, #boron, #aluminium, #cerium, #thorium {
  grid-column-start: auto;
  }
  .periodic-table {
  grid-template-columns: 1fr 1fr 1fr;
  }
  .periodic-table > li abbr {
    font-size: 0;
  }
  .periodic-table > li {
    padding: 1rem;
  }
  .periodic-table > li abbr:after {
    content: attr(title);
    font-size: 2rem;
  }
  .periodic-table > li:before {
    font-size: 1rem;
  }
  .periodic-table > li:nth-child(n+58):nth-last-child(n+48) {
  grid-row-start: auto !important;
}
  .periodic-table > li:nth-child(n+90):nth-last-child(n+16) {
    grid-row-start: auto !important;
  }
  .periodic-table:before {
    display: none !important;
  }
}
@media all and (max-width: 750px) {
  body {
    margin: 2vw;
  }
  .periodic-table {
    grid-template-columns: 1fr 1fr;
  }
  .periodic-table > li {
    height: auto;
    font-size: 3vw;
  }
}
@media all and (max-width: 550px) {
  .periodic-table {
    grid-template-columns: 1fr;
  }
}
/*Phần khác*/
.periodic {
  position: relative;
  height: 200px;
  margin-right: -1px;
  text-shadow: none;
}
.periodic-row {
  clear: both;
  height: 10%;
}
.cell {
  float: left;
  position: relative;
  width: 5.55%;
  height: 100%;
}
.element {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 1px;
  right: 1px;
  box-sizing: border-box;
  box-shadow: 0px 0px 4px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  cursor: default;
  transition: all 200ms ease;
  background-color: rgba(0, 128, 128, 0.6);
}
.cell:hover .element {
  border-color: rgba(0, 0, 0, 0.1);
  transform: scale(3, 3);
  z-index: 1;
  background-color: rgba(0, 128, 128, 0.9);
}
.at_num,
.at_details {
  position: absolute;
  font-size: 4px;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
}
.at_num {
  top: 4px;
  right: 5px;
}
.symbol {
  position: absolute;
  top: 50%;
  left: 0px;
  right: 0px;
  margin-top: -4px;
  font-size: 9px;
  line-height: 1;
  height: 9px;
  color: rgba(255, 255, 255, 0.9);
}
.at_details {
  bottom: 4px;
  left: 0px;
  right: 0px;
}
.cell:nth-child(-n + 2) .element,
.cell:nth-child(n + 13) .element {
  background-color: rgba(0, 160, 96, 0.6);
}
.cell:nth-child(1) .element,
.periodic-row:nth-child(2) .cell:nth-child(n + 14) .element,
.periodic-row:nth-child(3) .cell:nth-child(n + 15) .element,
.periodic-row:nth-child(4) .cell:nth-child(n + 16) .element,
.periodic-row:nth-child(5) .cell:nth-child(n + 17) .element {
  background-color: rgba(0, 192, 64, 0.6);
}
.periodic-row:nth-child(-n + 6) .cell:nth-child(18) .element {
  background-color: rgba(64, 192, 0, 0.6);
}
.periodic-row:nth-child(n + 9) .element {
  background-color: rgba(0, 96, 160, 0.6);
}
.cell:nth-child(-n + 2):hover .element,
.cell:nth-child(n + 13):hover .element {
  background-color: rgba(0, 160, 96, 0.9);
}
.cell:nth-child(1):hover .element,
.periodic-row:nth-child(2) .cell:nth-child(n + 14):hover .element,
.periodic-row:nth-child(3) .cell:nth-child(n + 15):hover .element,
.periodic-row:nth-child(4) .cell:nth-child(n + 16):hover .element,
.periodic-row:nth-child(5) .cell:nth-child(n + 17):hover .element {
  background-color: rgba(0, 192, 64, 0.9);
}
.periodic-row:nth-child(-n + 6) .cell:nth-child(18):hover .element {
  background-color: rgba(64, 192, 0, 0.9);
}
.periodic-row:nth-child(n + 9) .cell:hover .element {
  background-color: rgba(0, 96, 160, 0.9);
}
.cell:nth-child(1) .element {
  transform-origin: 0 50%;
}
.cell:nth-child(18) .element {
  transform-origin: 100% 50%;
}
.periodic-row:nth-child(10) .cell .element {
  transform-origin: 50% 100%;
}
.periodic-row:nth-child(1) .cell:nth-child(1) .element {
  transform-origin: 0 0;
}
.periodic-row:nth-child(1) .cell:nth-child(18) .element {
  transform-origin: 100% 0;
}
.periodic-row:nth-child(10) .cell:nth-child(18) .element {
  transform-origin: 100% 100%;
}