我需要扩展网站,以便它在移动设备上具有相同的功能

发布于 2025-01-29 07:09:47 字数 96 浏览 4 评论 0原文

我需要扩展一个网站,以便在手机上呈现一个储备按钮。该网站在PC和笔记本电脑上运行良好,但在手机上不正常。我尝试过@media(最大宽度:600px),而且似乎根本没有做任何事情。

I need to scale a website so that it renders a reserve button on mobile phones. The website works fine on PCs and laptops but not on phones. I have tried @media (max-width: 600px) as well as and it seems to be doing nothing at all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝天白云 2025-02-05 07:09:47

嵌套可能会有问题。
ex:您现在有这样

 <div>
    <ul>
        <li>Good</li>
        <li>Best</li>
        <li>Fair</li>
        <li>Nice</li>
    </ul>
</div>

代码

div ul li {
  color:red;
}

@media (max-width:690px) {
  li {
    color:red;
  }
}

对于

div ul li {
  color:red;
}

@media (max-width:690px) {
  div ul li {
    color:red;
  }
}

There can be problem with nesting.
For ex : You have code like this

 <div>
    <ul>
        <li>Good</li>
        <li>Best</li>
        <li>Fair</li>
        <li>Nice</li>
    </ul>
</div>

Now there are two examples of css one wrong and one right

Wrong Css

div ul li {
  color:red;
}

@media (max-width:690px) {
  li {
    color:red;
  }
}

Right Css

div ul li {
  color:red;
}

@media (max-width:690px) {
  div ul li {
    color:red;
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文