.index { display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; text-align: center; min-height: 100vh; } @media only screen and (max-width: 639px) { .index h1 { font-size: 5rem; } .index h2 { font-size: 1.5rem; } } @media only screen and (min-width: 640px) { .index h1 { font-size: 10rem; } .index h2 { font-size: 2.5rem; } }