CSS在don'之后和之前悬停面包屑;不要变色

CSS在don'之后和之前悬停面包屑;不要变色,css,breadcrumbs,Css,Breadcrumbs,无法让这个简单的代码与css一起工作。这段代码在我的JSP页面上运行良好,但我无法让鼠标悬停打开:before和:after的颜色 HTML 当在伪元素上给出:hover效果时,它应该类似于:hover:before 在这个例子中,我做了一个:hover效果。看一看 如前所述,您需要使用:hover:before更改伪元素悬停状态。由于您的示例缺少悬停状态,因此我进一步清理了所有内容以获得完整的解决方案 所有伪元素都位于其父元素之外,因此它们可以有一个透明的边框,用于任何背景图像或颜色 HT

无法让这个简单的代码与css一起工作。这段代码在我的JSP页面上运行良好,但我无法让鼠标悬停打开
:before
:after
的颜色

HTML


当在
元素上给出
:hover
效果时,它应该类似于
:hover:before

在这个例子中,我做了一个
:hover
效果。看一看


如前所述,您需要使用
:hover:before
更改伪元素悬停状态。由于您的示例缺少悬停状态,因此我进一步清理了所有内容以获得完整的解决方案

所有伪元素都位于其父元素之外,因此它们可以有一个透明的边框,用于任何背景图像或颜色

HTML


使用
:悬停:在
等之前,而不是相反方向。
<div class="wizard">
   <a class="inicio"><span></span>Anterior</a>
   <a class="badge">
   <span>
   <h:outputText value="#{EController.form.mes} - #{EController.form.ano}" styleClass="tituloMes" style="border-bottom-style: none; border-bottom-width: 0px; height: 14px; font-size: 12pt;vertical-align:initial;">   </h:outputText>
   </span>
   </a>
   <a class="fim"><span></span>Próximo</a>
</div>
.wizard .badge {
    padding: 10px 12px 10px;
    margin-right: 5px;
    background: #efefef;
    position: relative;
    display: inline-block;
}
.wizard .badge:before {
    width: 0;
    height: 0;
    border-top: 20 solid #FFF;
    border-bottom: 20 inset #FFFFFF;
    border-right: 20 solid #efefef;
    position: absolute;
    content:"";
    top: 0;
    left: 0;
}
.wizard .badge:after {
    width: 0;
    height: 0;
    border-top: 20px inset transparent;
    border-bottom: 20px inset transparent;
    border-left: 20px solid #efefef;
    position: absolute;
    content:"";
    top: 0;
    right: -20px;
    z-index: 2;
}
.wizard .fim {
    padding: 10px 0px 5px 0px;
    margin-right: 5px;
    background: #007ACC;
    position: relative;
    display: inline-block;
    width: 100px;
    height: 25px;
    color: white;
    font-family: sans-serif;
}
.wizard .fim:before {
    width: 0;
    height: 0;
    border-top: 20px inset transparent;
    border-bottom: 20px inset transparent;
    border-left: 20px solid white;
    position: absolute;
    content:"";
    top: 0;
    left: 0;
}
.wizard .fim:after {
    width: 0;
    height: 0;
    border-top: 20px inset transparent;
    border-bottom: 20px inset transparent;
    border-left: 20px solid #007ACC;
    position: absolute;
    content:"";
    top: 0;
    right: -20px;
    z-index: 2;
}
.wizard .inicio {
    padding: 10px 12px 10px;
    margin-right: 5px;
    background: #007ACC;
    position: relative;
    display: inline-block;
    width: 75px;
    height: 20px;
    color: white;
    font-family: sans-serif;
}
.wizard .inicio:before {
    width: 0;
    height: 0;
    border-top: 20px solid #FFF;
    border-bottom: 20px inset #FFFFFF;
    border-right: 20px solid #007ACC;
    position: absolute;
    content:"";
    top: 0;
    left: 0;
}
.wizard .inicio:after {
    width: 0;
    height: 0;
    border-top: 20px solid #007ACC;
    border-bottom: 20px inset #007ACC;
    border-right: 20px solid transparent;
    position: absolute;
    content:"";
    top: 0;
    right: -20px;
    z-index: 2;
}
.wizard .inicio:hover {
    background: rgb(86, 180, 243);
    color: #FFF;
}
.wizard .fim:hover {
    background: rgb(86, 180, 243);
    color: #FFF;
}
.wizard .fim:before:hover {
    background: rgb(86, 180, 243);
    color: #FFF;
}
.wizard .fim:after:hover {
    background: rgb(86, 180, 243);
    color: #FFF;
}
.wizard .inicio:before:hover {
    width: 0;
    height: 0;
    border-top: 20px solid #FFF;
    border-bottom: 20px inset #FFFFFF;
    border-right: 20px solid #rgb(86, 180, 243);
    position: absolute;
    content:"";
    top: 0;
    left: 0;
}
.tituloMes {
    font-family: Helvetica, Arial, Verdana, sans-serif;
    text-align: center;
    font-size: 14pt;
    font-weight: bold;
    color: #0073b9;
    /** margin-left: 10px; **/
    padding-left: 10px;
    padding-right: 4px;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    height: 20px;
    vertical-align:top;
}
.wizard .inicio:hover{
    background: rgb(86, 180, 243);
    color: #FFF;
}
.wizard .inicio:hover:before{
    border-top: 20px solid #FFF;
    border-bottom: 20px inset #FFFFFF;
    border-right: 20px solid rgb(86, 180, 243);
    color: #FFF;
}
.wizard .inicio:hover:after{
    border-top: 20px solid rgb(86, 180, 243);
    border-bottom: 20px inset rgb(86, 180, 243);
    border-right: 20px solid transparent;
    color: #FFF;
}
<div class="wizard">
    <a class="inicio">test1</a>
    <a class="badge">Badge can be super long</a>
    <a class="fim">test2</a>
</div>
.wizard {
display:table;
margin:0 auto;
}

.wizard .badge {
background:#efefef;
position:relative;
display:inline-block;
text-align:center;
margin:0 30px;
padding:10px 12px;
}

.wizard .badge:after {
width:0;
height:0;
border-top:20px inset transparent;
border-bottom:20px inset transparent;
border-left:20px solid #efefef;
position:absolute;
content:"";
top:0;
right:-20px;
}

.wizard .badge:before {
width:0;
height:0;
border-top:20px inset transparent;
border-bottom:20px inset transparent;
border-right:20px solid #efefef;
position:absolute;
content:"";
top:0;
left:-20px;
}

.wizard .fim {
background:#007ACC;
position:relative;
display:inline-block;
width:85px;
height:25px;
color:#FFF;
font-family:sans-serif;
text-align:right;
padding:10px 0 5px;
}

.wizard .fim:after {
width:0;
height:0;
border-top:20px inset transparent;
border-bottom:20px inset transparent;
border-left:20px solid #007ACC;
position:absolute;
content:"";
top:0;
right:-20px;
}

.wizard .fim:before {
width:0;
height:0;
border-top:20px solid #007ACC;
border-bottom:20px inset #007ACC;
border-left:20px solid transparent;
position:absolute;
content:"";
top:0;
left:-20px;
}

.wizard .fim:hover:after {
border-top:20px solid transparent;
border-bottom:20px inset transparent;
border-left:20px solid #56b4f3;
}

.wizard .fim:hover:before {
border-top:20px solid #56b4f3;
border-bottom:20px inset #56b4f3;
border-left:20px solid transparent;
}

.wizard .inicio {
background:#007ACC;
position:relative;
display:inline-block;
width:65px;
height:20px;
color:#FFF;
font-family:sans-serif;
padding:10px 12px 10px 0;
}

.wizard .inicio:after {
width:0;
height:0;
border-top:20px solid #007ACC;
border-bottom:20px inset #007ACC;
border-right:20px solid transparent;
position:absolute;
content:"";
top:0;
right:-20px;
}

.wizard .inicio:before {
width:0;
height:0;
border-top:20px solid transparent;
border-bottom:20px inset transparent;
border-right:20px solid #007ACC;
position:absolute;
content:"";
top:0;
left:-20px;
}

.wizard .inicio:hover,.wizard .fim:hover {
background:#56b4f3;
color:#FFF;
}

.wizard .inicio:hover:after {
border-top:20px solid #56b4f3;
border-bottom:20px inset #56b4f3;
border-right:20px solid transparent;
}

.wizard .inicio:hover:before {
border-top:20px solid transparent;
border-bottom:20px inset transparent;
border-right:20px solid #56b4f3;
}