【问题标题】:Inline css for superfish超级鱼的内联 CSS
【发布时间】:2012-11-12 15:18:36
【问题描述】:

我正在尝试修改我的导航栏子菜单并且能够找到它是什么。在下面的代码中,我只需要将宽度从 12em 更改为“auto”即可修复子菜单。目前,文本与背景重叠。

element.style {
  float: none;
  width: 12em; 
  visibility: hidden;
  display: none;
}

引用菜单的html文件是这样的:

<div class="menu-box">
<div id="menu-bar" class="nav clearfix">
<nav id="block-superfish-1" class="block block-superfish block-odd block-count-2 block-region-menu-bar menu-wrapper clearfix clearfix" role="navigation">
<h2 class="block-title element-invisible element-invisible">Main menu</h2>
<ul id="superfish-1" class="sf-menu main-menu sf-horizontal sf-style-none sf-total-items-5 sf-parent-items-4 sf-single-items-1 main menu sf-js-enabled sf-shadow">
<li id="menu-218-1" class="first odd sf-item-1 sf-depth-1 main menu list sf-total-children-1 sf-parent-children-0 sf-single-children-1 menuparent">
<a class="sf-depth-1 menuparent" href="/">Home</a>
<ul style="float: none; width: 12em; display: none; visibility: hidden;">
</li>
<li id="menu-409-1" class="middle even sf-item-2 sf-depth-1 main menu list sf-total-children-2 sf-parent-children-0 sf-single-children-2 menuparent">
<a class="sf-depth-1 menuparent" href="/%3Cnolink%3E">What's exciting us</a>
<ul style="float: none; width: 12em; visibility: hidden; display: none;">
<li id="menu-411-1" class="first odd sf-item-1 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<a class="sf-depth-2 " href="/around-the-globe" style="float: none; width: auto;">Innovative ideas from around the globe</a>
</li>
<li id="menu-410-1" class="last even sf-item-2 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<a class="sf-depth-2 " href="/showcased-ideas" style="float: none; width: auto;">Showcased ideas from within the community</a>
</li>
</ul>
</li>
<li id="menu-412-1" class="middle odd sf-item-3 sf-depth-1 main menu list sf-total-children-3 sf-parent-children-0 sf-single-children-3 menuparent">
<a class="sf-depth-1 menuparent" title="" href="/%3Cnolink%3E">Shared insight</a>
<ul style="float: none; width: 12em; visibility: hidden; display: none;">
<li id="menu-413-1" class="first odd sf-item-1 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<a class="sf-depth-2 " href="/expert-panel" style="float: none; width: auto;">Expert Panel</a>
</li>
<li id="menu-414-1" class="middle even sf-item-2 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<a class="sf-depth-2 " href="/investment-community" style="float: none; width: auto;">Investment Community</a>
</li>
<li id="menu-415-1" class="last odd sf-item-3 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<a class="sf-depth-2 " title="" href="/thought-leaders" style="float: none; width: auto;">Thought Leaders</a>
</li>
</ul>
</li>
<li id="menu-420-1" class="middle even sf-item-4 sf-depth-1 main menu list sf-total-children-3 sf-parent-children-0 sf-single-children-3 menuparent">
<a class="sf-depth-1 menuparent" href="/%3Cnolink%3E">Interact</a>
<ul style="float: none; width: 12em; visibility: hidden; display: none;">
<li id="menu-421-1" class="first odd sf-item-1 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<li id="menu-758-1" class="middle even sf-item-2 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
<li id="menu-422-1" class="last odd sf-item-3 sf-depth-2 main menu list sf-no-children" style="white-space: normal; float: left; width: 100%;">
</ul>
</li>
<li id="menu-312-1" class="last odd sf-item-5 sf-depth-1 main menu list sf-no-children">
</ul>
</nav>
</div>
</div>

我不知道要编辑什么样式表和哪一行。

顺便说一句,我正在使用 Drupal 7 和 superfish 模块。

【问题讨论】:

  • 你应该只使用调试工具,比如 firebug,来找到你问题的答案......(但如果它真的在 element.style 上,你应该在代码中搜索,而不是在css! element.style = inline css(可能在模板中?))
  • 您能否提供一个代码示例来显示您所有的 CSS 和 HTML?目前,您还没有为我们提供足够的信息来解决问题。
  • 这甚至不是一个有用的 html 块。我们应该如何处理一堆甚至不包含结束标签的东西?
  • 更新了html代码。我希望它有所帮助。“ul 风格”是需要注意的。我不知道在什么文件上。具体宽度。

标签: css drupal superfish


【解决方案1】:

这些看起来像在 Superfish 的 Supersubs 插件下设置的默认宽度。

您可以通过配置相关菜单块来编辑宽度,并在 Superfish Plugins > Supersubs 下编辑最小和最大宽度。

或者,您可以禁用 Supersubs 并在样式表中设置宽度。

【讨论】:

    【解决方案2】:

    遇到同样的问题。

    我通过从模块文件夹中删除 superfish.js 来修复它。 (使用版本 7.x-1.9-beta4)
    否则这可能会对您有所帮助:Superfish dropdown menu width

    【讨论】:

    • 另一个解决方案是禁用超级潜艇。
    猜你喜欢
    • 1970-01-01
    • 2021-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多