JSFiddle - React, Tailwind, and code Playground

by Douglas Santos

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Essa tag é importante -->
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Exemplo responsividade</title>
</head>
<body>
  <div class="content">
    <input type="text" />
  </div>
</body>
</html>

CSS

/* propriedades comuns à todas as resoluções */

.content{
  width: 100%;
  height: 300px;
  background-color: #473
} 

input[type="text"]{
  margin: 10px;
  width: 200px;
}

/* propriedades apenas entre 480px e 959px */

@media(max-width: 959px) {
    
  .content{
    background-color: #356
  } 

  input[type="text"]{
    width: 100px;
  }

}

/* propriedades apenas até 479px */

@media(max-width: 479px) {
    
  .content{
    background-color: #4aa
  } 

  input[type="text"]{
    width: 50px;
  }

}