- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我希望有一个简单的 css 修复程序。问题很简单,我正在制作一个自定义的 wordpress 主题,我正在使用一些自定义菜单,代码工作正常,但我制作了一个带有分隔符的内联菜单 css 样式(由 border-left: 1px 等制成,请参阅 css。)并且存在显示错误。
当它是默认的 wordpress 菜单(wordpress 页面列表)时,菜单显示正常,但是当我使用 wordpress 管理面板中的菜单编辑器插入自定义链接时,分隔符被某种空格插入!
参见 jsFiddle illustrating the problem对于生成的 html
函数.php
register_nav_menus(
array( 'header-menu' => __( 'Header Menu' ), 'footer-menu' => __( 'Footer Menu' ))
);
页脚.php
<div id="last-footer">
<div id="last-footer-container" class="container_12">
<div id="last-footer-menu" class="grid_12" align="center">
<?php
wp_nav_menu( array( 'theme_location' => 'footer-menu' ) );
?>
</div>
<div class="clear"></div>
<!-- other stuff here (widgets) -->
</div><!-- #last-footer-container end -->
style.css(用 lesscss 生成 :P)
#last-footer {
background:#222;
color:white;
}
#last-footer-container {
padding-bottom:10px;
padding-top:10px;
}
#last-footer-container a { color:#a62e0d; }
#last-footer-container a:hover {
text-decoration:none;
color:#602000;
text-shadow:1px 1px 1px black;
}
#last-footer-container span { float:left; }
#last-footer-menu ul {
margin:0;
padding:0;
}
#last-footer-menu ul li {
border-left:1px solid #121212;
border-right:1px solid #323232;
display:inline;
padding-left:10px;
padding-right:10px;
margin:0;
}
#last-footer-menu ul li:first-child { border-left:none; }
#last-footer-menu ul li:last-child { border-right:none; }
最佳答案
我想我应该看看这个,结果也让我抓狂。该问题与 #last-footer-menu ul li
选择器上的 display: inline
有关。
我最终只是 float 了每个链接,然后使用这种古老的技术创建了一个居中的导航菜单 - Horizontally centering an unordered list
这是 JS Fiddle -> http://jsfiddle.net/rabmcnab/zvCsC/1/
我希望看到一些更简洁、更简洁的解决方案,我们将看看是否有人考虑使用更少的 CSS 更改来实现的替代方案。
关于html - Wordpress wp_nav_menu 仅在使用自定义菜单时中断链接布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12061784/
我的网址是这样的: http://domain.com/?s=searchquery&post_type=qa_faqs 该页面列出了“searchquery”的搜索结果。 然后我得到了帖子类型 $p
有没有办法改变 child 由 WordPress 本身生成自定义类名? 我认识家长您可以使用 'menu_class' => 'newname' 删除或更改名称. 我找不到答案。我试过'submen
如何在网站标题中垂直居中 det wordpress 函数 wp_nav_menu?我已经使用了 learnWebCode 菜单教程链接:https://www.youtube.com/watch?v
我有以下代码: $nav_menu_args = array('fallback_cb' => '','menu' => 'menu', 'menu_class' => 'menu_class');
我正在尝试从我的 wordpress 菜单中删除特定链接: First Second Third function remove_link( $menu ) { return str_repl
这是一个 self 问答。 如何修改 wp_nav_menu 输出中出现的文本/html?例如,我想为页面和类别添加特色图像。 您会看到使用自定义步行器执行此操作的示例,但对于小的更改来说,代码非常复
在我的主题中有一个导航菜单功能 function ct_nav() { 'nav', 'theme_location' => 'primary') ); ?> } 如何手动添加
我需要使用 wp_nav_menu 设置一些分页,所以我需要访问菜单中的上一个、当前和下一个项目。有什么想法吗? 最佳答案 好的,这就是我想出的——而且它有效。 term_id, array( 'or
我正在尝试使用我在另一个站点上使用的脚本来让我的导航菜单下拉菜单正确地设置动画。 这是脚本: jQuery(window).load(function() { $("#menu > div >
哦,光荣的 Stack,给我谜语吧;为什么我的 wp_nav_menu 没有样式? 我的 function.php 设置如下: 'Header Navigation')); } ?> 我的 wp_n
如何转换: menu1 到 wp_nav_menu 里面的div和class太多了,谁能帮我解决这个问题?谢谢! 最佳答案 这可以使用 css 中的 nth-child() 选择器来完
我使用 wordpress 函数 wp_nav_menu() 来显示我在 WP 菜单中创建的分层菜单。这是片段: 这是它的 html 输出: Home Page Il film Di ch
我正在尝试使用 wp_nav_menu() 制作按钮菜单,但是当我尝试将文本(有时是三行或两行文本)放置在背景图像的中间时,我无法垂直对齐。将鼠标悬停在我想添加的链接上时,它似乎不起作用。 CSS .
我该怎么做: 我想使用 wp_nav_menu() 创建菜单并稍微自定义它的输出 html。我想把 在链接 在每个 里面菜单项。 我知道我可以使用 的背景图像来完成此操作css 中的元素,但我的目
它包含 家, 公司, 帮助支持, 产品, 定价,和 登录。 我在页眉的导航栏中使用它,我将在页脚中使用它。在页脚中,它只会显示所有菜单项,但不包括登录。我该怎么办?我是 wordpress 的新手。
我希望有一个简单的 css 修复程序。问题很简单,我正在制作一个自定义的 wordpress 主题,我正在使用一些自定义菜单,代码工作正常,但我制作了一个带有分隔符的内联菜单 css 样式(由 bor
我环顾四周,似乎找不到一种直接的方法来做到这一点。我有一个使用 wp_nav_menu 的下拉菜单的页面列表,我只想将指向您当前所在页面的链接设为不同的颜色。 最佳答案 您是否尝试过使用选择器 cur
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve th
如何在 wp_nav_menus 中添加图标?..这是我设计的图片 http://postimg.org/image/w7x2hfn75/ 我想把第一个菜单做成图标,有什么办法吗?.. 我的代码 '
我有一个名为“header-menu”的菜单,我只希望这个菜单受到我在下面编写的函数的影响。如何防止其他菜单受到影响? 脚本在 header.php 中是这样调用的 'header-menu');
我是一名优秀的程序员,十分优秀!