7
7
75db772019-11-11 23:35:21
css
75db77, 2019-11-11 23:35:21

Why can't the site be responsive? Maybe adaptability is done wrong?

There is an input: In css, the width of the input is 300px. And header with span where there are titles
<input type="text" class="searchInput" />

<div className="header">
                       <span>О нас</span>
                        <span>Телефон</span>
                        <span>На главную</span>
              </div>

I want to make the site adaptive for various devices, I write:
@media screen and (max-width: 1000px) {
  .header span {
      display: none;
   }
    .searchInput{
   width: 100px;
 }
}

I look in the browser how the site looks on the smartphone. span is gone from hedear. Fine. But the input didn't shrink to 100px.... I noticed that some selectors are subject to responsiveness and others are not. Why is that? Maybe adaptability is done in a different way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2019-11-12
@flokiowl

Do you have such a meta tag in the head ?
Perhaps the element's original styles are overridden and you can't override them.
Write media queries at the end of the document.
About weight

V
VeryLongAgoDid, 2019-11-12
@VeryLongAgoDid

max-width
sometimes works wonders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question