@media print{ /*印刷のとき*/ h1, table, tr, th, td {color: #000000;} } /*@media 順番大事 上書きされていくから大きいものから書く*/ @media (orientation: portrait){/*縦向き=縦長の場合*/ h1{ text-decoration: underline #f39800; /*テキストの装飾*/ } } @media (orientation: landscape){/*横向き=横長)の場合*/ h1{ width: 10ex; /*幅10文字で*/ float: left; /*要素を左寄せ*/ background-color: #ffffff; padding: 1ex; } } /*全体*/ body { background-color: #f5deb3; /*背景 色指定*/ margin: 3ex; /*余白*/ } table { /*左右の空間を均等に最大にする=中央寄せにする*/ margin-left: auto; /*左側の空間を最大にする=右寄せにする*/ margin-right: auto; /*右側の空間を最大にする=左寄せにする*/ background-color: #ffffff; } table, th, tr, td { border: solid 1px #000000; } /*1行目*/ th:first-child {background-color: #f7f7f7;} th.mon {background-color: #f08080;} th.tue {background-color: #ffb6c1;} th.wed {background-color: #87cefa;} th.thu {background-color: #90ee90;} th.fri {background-color: #f0e68c;} /*1列目*/ td:first-child {background-color: #efe0ff;}