【问题标题】:How to locate the CSS Selector for the nav-menu and the menu button?如何找到导航菜单和菜单按钮的 CSS 选择器?
【发布时间】:2019-12-08 20:08:40
【问题描述】:

我的网站是https://thunderandmiles.com,有人可以帮忙吗?我将站点导航 ID 设置为“站点导航”,将菜单按钮 ID 设置为“btn-toggle”。

【问题讨论】:

  • 您好,您能详细解释一下您的问题吗?你想在这些元素上应用 CSS 吗?如果这是问题所在,并且您在两者中都有 id 属性,则应该执行 #Site-Navitation{...}#btn-toggle{...}

标签: wordpress mmenu


【解决方案1】:

菜单按钮是一个类而不是一个 id,因此您需要 .btn-toggle 作为 CSS 选择器。

不过,这将选择该类的所有元素。建议您添加 id="btnToggle" 或您喜欢的任何 id 来选择该特定元素。

您的导航元素的 id 为 site-navigation,因此请使用 #site-navigation 的 css 选择器来选择它。

这里有区分大小写的信息:Are class names in CSS selectors case sensitive?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2015-09-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多