【问题标题】:@media doesn't work I cant understand why it is dont work@media 不起作用我不明白为什么它不起作用
【发布时间】:2021-07-10 07:08:48
【问题描述】:

我尝试了很多,但请注意工作帮助。仅用于文本 klsldkjslkfjslfjljdkljb mvbncfgvsdfs dfs srtsdfgxxb

    .right_form {
        width: 300px;
        height: 350px;
        background-color: #fff;
        position:relative;
        margin-left: 300px;
        }
      @media (max-width: 1460px) {
    .right > .right_form {
        margin-left: 0;
    }

}
   <div class="right" >
        <form action="POST" class="right_form">
            <label class="first_label">Try Your <span style="color:#FF8B38;">&nbsp;  FREE &nbsp;  </span> Trial Today</label>
            <section class="form_bars">
            <input type="text" class = "inputs" placeholder=" Name">
            <input type="email" class = "inputs" placeholder=" Email">
            <input type="password" class = "inputs" placeholder=" Password">
            <button type="submit" class = "form_button" >Get Started</button>
        </section>
        <!--End of section form_bars -->
        </form>
    </div>
</section>

【问题讨论】:

  • in media must be margin-left (error)
  • 如果这解决了您的问题,您可以删除您的问题:-)
  • CSS 不支持嵌套媒体查询,所以需要移出。并更改为margin-left: 0
  • @nghiepit 他已将其标记为 sass 并且 sass 支持它。
  • @Colder_Host 你还没有问我们什么。

标签: html css sass


【解决方案1】:

永远不会应用媒体查询,因为您将 .right_form 嵌套到自身中。请参阅下面的 scss 生成的输出。

.right_form {
  width: 300px;
  height: 350px;
  background-color: #fff;
  position: relative;
  margin-left: 300px;
}
@media (max-width: 1460px) {
  .right_form .right > .right_form {
    margin-right: 0;
  }
}

【讨论】:

  • 很抱歉忘记了scobe
猜你喜欢
  • 2014-04-20
  • 1970-01-01
  • 2019-06-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-23
  • 2021-10-07
  • 1970-01-01
相关资源
最近更新 更多