h1 { font-weight: normal; font-size: 15mm; margin: 0; } h1.title { float: left; } h1.page-number { float: right; text-align: right; } .shelf { position: relative; margin: 0 auto; padding-top: 40mm; } .edge, .tray { position: absolute; border: 1px solid black; box-sizing: border-box; } .box { position: absolute; border: 1px solid black; text-align: center; } .box > span { font-size: 70%; text-align: center; margin: 5%; display: inline-block; line-height: 100%; vertical-align: middle; } .color0 { background-color: #ECC !important; } .color1 { background-color: #CEC !important; } .color2 { background-color: #CCE !important; } .color3 { background-color: #ECE !important; }