如何让WordPress二十十个主题子菜单扩展到其内容(CSS)?

发布于 2024-08-31 13:26:04 字数 459 浏览 0 评论 0原文

希望这不是“太”小众,因为涉及的 CSS 可能适用于其他地方。

我正在 WordPress 3 beta/nightlies 中使用新的二十十主题,如果下拉子菜单(页面/自定义菜单)能够扩展到其中任何内容的宽度,我真的很喜欢它,而不是比以 130px 包裹项目。

下面是一个示例页面设置,仅包含相关 HTML 和二十十主题 CSS 文件: http ://almostexciting.com/wordpress-twentyten-menu.html

我尝试将链接项的“宽度”更改为“最小宽度”,但这不起作用 - 也不能完全删除它。我似乎找不到任何其他限制菜单项宽度的样式,所以我有点迫切需要帮助。

在 Firebug 中撕毁这个东西已经太久了。

Hope this isn't "too" niche, because the CSS involved likely applies in other spots.

I'm working with the new Twenty Ten theme in WordPress 3 beta/nightlies, and I'd really like it if the drop-down sub-menus (Pages/custom menus) would expand to the width of whatever is in them, rather than wrap the items at 130px.

Here's an example page set up that contains nothing but the relevant HTML and the Twenty Ten theme CSS file: http://almostexciting.com/wordpress-twentyten-menu.html

I've tried changing the "width" for the link items to a "min-width", which doesn't work - nor does completely removing it. I can't seem to locate any other styles that are constricting the width of the menu items, so I'm a bit desperate for help.

Been tearing this thing up in Firebug for too long now.

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

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

发布评论

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

评论(1

桃扇骨 2024-09-07 13:26:04

删除链接的定义宽度。

添加这个:

#access ul ul a {white-space: nowrap;}

还有这个:

#access .menu-header ul, div.menu ul {background-color: #333;}

Remove the defined width for your links.

Add this:

#access ul ul a {white-space: nowrap;}

And this:

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