:root { background-image: linear-gradient(to bottom, #e4dadf 0%, #fff 100%); box-sizing: border-box; color: #0074d9; /* blue */ font: normal small 'Old Standard TT', serif; min-height: 100%; padding-top: 0; text-align: center; } *, *:before, *:after { box-sizing: inherit; } h1 { background-color: #dbc6d0; /* pink */ border: 1px solid rgba(255,255,255,0.9); border-radius: 0; box-shadow: 0 -1px 3px -1px rgba(0,0,0,0.25); color: #001f3f; /* navy */ cursor: pointer; display: block; font: 400 170%/2.5 'Oswald', sans-serif; letter-spacing: 0.02em; margin: 2px; padding: 0; text-shadow: 0 1px 0 rgba(255,255,255,0.6); } h1:hover { background-color: #d1b3c2; /* darker pink */ color: #111; } .active { background: #fff; border: 1px solid #aaa; box-shadow: none; color: #0074d9; /* blue */ position: relative; z-index: 1; } h1[class="active"]:hover { background-color: #fff; color: #0074d9; /* blue */ } p { display: none; font-size: 120%; font-style: italic; position: absolute; left: 0; top: 12em; /* depends on size, amount of tabs */ width: 100%; } .active + p { display: block; } @media (min-width: 30em) { :root { background-image: none; background-color: #e4dadf; font-size: large; min-height: 100%; padding-top: 3.75em; } h1 { border-bottom: none; border-radius: 8px 8px 0 0; color: #001f3f; /* navy */ cursor: pointer; display: inline-block; letter-spacing: 0.02em; line-height: 1.5; margin: 0 1px; padding: 8px 12px; } .active { background: #fff; border-bottom: none; color: #0074d9; /* blue */ padding-bottom: 8px; position: relative; z-index: 1; } h1[class="active"]:hover { background-color: #fff; color: #0074d9; } p { background-image: linear-gradient(to bottom, #fff 0%, #e4dadf 100%); border-top: 1px solid #aaa; font-size: 120%; left: calc(50% - 50%); /* centers the bottom paragraph (50% of 1/2 of the width) */ margin-top: 0; /* erases the bottom border of the active tab */ min-height: 75%; padding-top: 1.875em; position: absolute; top: 6em; /* depends on size of tabs */ width: 100%; /* extends the border full width */ } .active + p { display: block; } }