.a{ width: 10vw; display: flex; justify-content: center; background: #4F46E5; height: 5vh; border-radius: 12px; margin-top: 2em; margin-left: 2em; } .a:hover{ border: 1px solid #4F46E5; background: none; transition: 0.2s; } .a a:hover{ color: #4F46E5; } .a a{ margin-top: 6px; color: white; } @media only screen and (max-width: 768px){ .a{ width: 120px; display: flex; justify-content: center; background: #4F46E5; height: 5vh; border-radius: 12px; margin-top: 2em; margin-left: 2em; } } @media only screen and (min-width: 1238px){ .a{ margin-left: 9em; } }