在 Wordpress 的 Breadcrumb NavXT 插件中应用样式时出现问题

发布于 2024-12-20 04:58:45 字数 2391 浏览 1 评论 0原文

我在将我的样式应用到 Breadcrumb NavXT 插件时遇到了巨大的问题。

当我使用 Breadcrumb NavXT 插件将样式应用于 WP 文档中的插件时,最后一段文本始终被前面的彩色箭头覆盖。

我已经尝试了明显的答案,例如对最后一个孩子应用边距权,但没有任何效果。真的很感激一些帮助。

这是 WP 输出的相关 html:

<!-- Breadcrumb NavXT 3.9.0 -->
<a title="Go to Blog." href="http://www.media.co.uk/wp">Blog</a> &gt; 
<a title="Go to Email &#038; SMS Broadcasting." href="http://www.media.co.uk/wp/  
email-sms-broadcasting/">Email &#038; SMS Broadcasting</a> &gt; Data List  
Management        </div><!--END breadcrumb -->

这是相关的CSS:

.breadcrumb{ list-style:none; overflow:hidden; position:absolute; font:10px    
Helvetica,Arial,Sans-Serif; top:160px; float:left}

.breadcrumb a{ color:white;  text-decoration:none;  padding:2px 0 2px 35px;     
background:blue; background:#728c8c; position:relative;  display:block; float:left}

.breadcrumb a:after{ content:"";  display:block;  width:0;  height:0;  
border-top:50px solid transparent;   border-bottom:50px solid transparent;  border-   
left:30px solid #728c8c;  position:absolute;  top:50%;  margin-top:-50px;  left:100%;  
z-index:2}

.breadcrumb a:before{ content:"";  display:block;  width:0;  height:0;  border- 
top:50px solid transparent;  border-bottom:50px solid transparent;  border-left:30px   
solid white;  position:absolute;  top:50%;  margin-top:-50px;  margin-left:1px;  
left:100%;  z-index:1}
.breadcrumb a:first-child { padding-left:10px;}

.breadcrumb a:nth-child(2) {background: #768c72}
.breadcrumb a:nth-child(2):after{border-left-color:#768c72}
.breadcrumb a:nth-child(3) {background: #909673}
.breadcrumb a:nth-child(3):after{border-left-color:#909673}
.breadcrumb a:nth-child(4) {background: #ad7601}
.breadcrumb a:nth-child(4):after{border-left-color:#ad7601}
.breadcrumb a:nth-child(5) {background: #E3E8E8}
.breadcrumb a:nth-child(5):after{border-left-color:#E3E8E8}
.breadcrumb a:nth-child(6) {background: #728c8c}
.breadcrumb a:nth-child(6):after{border-left-color:#728c8c}
.breadcrumb a:nth-child(7) {background: #768c72}
.breadcrumb a:nth-child(7):after{border-left-color:#768c72}
.breadcrumb a:last-child a{background:transparent !important;  color:black;  
pointer-events:none; cursor:default;}
.breadcrumb  a:hover{background:#526476}
.breadcrumb  a:hover:after{border-left-color:#526476 !important}

I am having enormous problems applying my styles to the Breadcrumb NavXT plugin.

When I apply the styles to the plugin in the WP document using the Breadcrumb NavXT plugin the last piece of text is always covered by the preceding colored arrow.

I have tried the obvious answers like apply margin-right to the last-child but nothing is working. Would really be grateful for some help.

Here is the relevant html that WP is outputting:

<!-- Breadcrumb NavXT 3.9.0 -->
<a title="Go to Blog." href="http://www.media.co.uk/wp">Blog</a> > 
<a title="Go to Email & SMS Broadcasting." href="http://www.media.co.uk/wp/  
email-sms-broadcasting/">Email & SMS Broadcasting</a> > Data List  
Management        </div><!--END breadcrumb -->

Here is the relevant css:

.breadcrumb{ list-style:none; overflow:hidden; position:absolute; font:10px    
Helvetica,Arial,Sans-Serif; top:160px; float:left}

.breadcrumb a{ color:white;  text-decoration:none;  padding:2px 0 2px 35px;     
background:blue; background:#728c8c; position:relative;  display:block; float:left}

.breadcrumb a:after{ content:"";  display:block;  width:0;  height:0;  
border-top:50px solid transparent;   border-bottom:50px solid transparent;  border-   
left:30px solid #728c8c;  position:absolute;  top:50%;  margin-top:-50px;  left:100%;  
z-index:2}

.breadcrumb a:before{ content:"";  display:block;  width:0;  height:0;  border- 
top:50px solid transparent;  border-bottom:50px solid transparent;  border-left:30px   
solid white;  position:absolute;  top:50%;  margin-top:-50px;  margin-left:1px;  
left:100%;  z-index:1}
.breadcrumb a:first-child { padding-left:10px;}

.breadcrumb a:nth-child(2) {background: #768c72}
.breadcrumb a:nth-child(2):after{border-left-color:#768c72}
.breadcrumb a:nth-child(3) {background: #909673}
.breadcrumb a:nth-child(3):after{border-left-color:#909673}
.breadcrumb a:nth-child(4) {background: #ad7601}
.breadcrumb a:nth-child(4):after{border-left-color:#ad7601}
.breadcrumb a:nth-child(5) {background: #E3E8E8}
.breadcrumb a:nth-child(5):after{border-left-color:#E3E8E8}
.breadcrumb a:nth-child(6) {background: #728c8c}
.breadcrumb a:nth-child(6):after{border-left-color:#728c8c}
.breadcrumb a:nth-child(7) {background: #768c72}
.breadcrumb a:nth-child(7):after{border-left-color:#768c72}
.breadcrumb a:last-child a{background:transparent !important;  color:black;  
pointer-events:none; cursor:default;}
.breadcrumb  a:hover{background:#526476}
.breadcrumb  a:hover:after{border-left-color:#526476 !important}

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

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

发布评论

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

评论(1

撩心不撩汉 2024-12-27 04:58:45

您可以将Data List Management包装在span中,然后添加CSS:

.breadcrumb span {
    float: right;
    padding: 2px 0 2px 20px;
}

您可以将float: right更改为display: inline< /code> 但这在 IE7 中不起作用。您还可以将其更改为 float: left - 这可能更好 - 但这似乎会导致 > HTML 出现问题。

编辑

根据Breadcrumb NavXT文档,您可以使用以下代码将当前元素项包装在跨度中:

//Set the current item to be surrounded by a span element
$breadcrumb_trail->opt['current_item_prefix'] = '<span>';
//Set the suffix to close the span tag
$breadcrumb_trail->opt['current_item_suffix'] = '</span>';

You could wrap Data List Management in a span and then add the css:

.breadcrumb span {
    float: right;
    padding: 2px 0 2px 20px;
}

You can change float: right to display: inline but that would not work in IE7. You could also change it to float: left - which is probably better - but this seems to cause issues with the > HTML.

Edit

According to the Breadcrumb NavXT Documentation, you can use the following code to wrap your current element item in a span:

//Set the current item to be surrounded by a span element
$breadcrumb_trail->opt['current_item_prefix'] = '<span>';
//Set the suffix to close the span tag
$breadcrumb_trail->opt['current_item_suffix'] = '</span>';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文