@media (orientation: portrait){ h1 {float-left: 10ex; background-color: #ffffff; padding: 1ex; } } @media (orientation: landscape){ h1 {text-align: center; border-bottom: solid 1px red; } } body {background-color: lightgreen;} h2 {text-align: center} table,tr {border: 1px solid;} td {border: 1px solid; width: 16ex; } tr {text-align: center;} td:first-child {width: 5ex;} tr:nth-child(2) td:nth-child(2) {color:blue; } tr:nth-child(2) td:nth-child(4) {color:blue; } tr:nth-child(6) td:nth-child(2) {color:red; }