button { width: 100%; padding: 10px; margin: 8px ; background-color: darkcyan; color: white; border: none; border-radius: 4px; cursor: pointer; } input{ width: 100%; } .webBox{ display: flex; justify-content: center; align-items: center; } .btnBG{ color: red; } @media screen and (max-width: 600px) { button { width: 100%; padding: 10px; margin: 8px ; background-color: #4CAF50;; color: white; border: none; border-radius: 4px; cursor: pointer; } button.btnColor { width: 100%; padding: 10px; margin: 8px ; background-color: #4CAF50;; color: red; border: none; border-radius: 4px; cursor: pointer; } }