1
I have a cell phone Moto G and I can’t define the @media
to work for him.
Reducing the width of the browser works perfectly, but the mobile device does not adjust according to the @media
.
Below I put the background of form
to turn gray, and nothing happens. Look what I did?
@media(max-width: 574px) {
.menutopo{
display: none;
}
figure.logo{
float: left;
width: 100%;
height: 80px;
background-color: #FF8922;
box-sizing: border-box;
}
section.frmbuscaguia{
float:left;
width: 100%;
min-width: 200px;
height: auto;
background-color: #ccc;
text-align: center;
margin-bottom: 5px;
box-sizing: border-box;
}
}
HTML
<figure class="logo">
<p class="text-center"><img src="./imagens/logo.png" align="center"></p>
</figure>
<section class="frmbuscaguia">
<h1>Buscar no Guia Comercial</h1>
<form>
<input type="text" name="buscar">
<button type="submit">Pesquisar</button>
</form>
</section>
have tried
@media screen and ()...
?– RFL
yes, I’ve tried!
– Gladison
If Chrome, it will only work if you clear your browser history.
– Lucas de Carvalho
Have you tried the
@media only screen and (max-width: 574px)...
?– usuario
@Newtech but nothing working
– Gladison
Set the tag
<meta name="viewport" content="width=device-width, user-scalable=no">
in the<head>
?– Bruna Gomes da Silva
Post an image of how the page is looking on the mobile screen. Check if the meta tag viewport is configured
– hugocsl
Just for the record, I ran some tests here and it’s very likely that your problem is the viewport itself, use the
<meta name="viewport">
that Bruna posted in the answer that you will solve the problem. And to understand why you decided to read this article https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag– hugocsl