通常,两个 .labout 跨度都是白色的,两个 .pabout 跨度都是黄色的。当悬停在上面时,我会将整个短语变为黑色。ie LEARN ABOUT FULL SERVICE 当按钮的任何部分悬停时显示为黑色,而不是单个跨度。
<div id="inner">
<a style="color:white" href="full-service/overview/" class="fs-button">
<span class="labout">LEARN ABOUT</span>
<span class="pabout"> FULL SERVICE</span>
</a>
<a style="color:white; vertical-align:middle;" href="diy/overview/" class="diy-button">
<span class="labout">LEARN ABOUT</span>
<span class="pabout"> DO IT YOURSELF</span>
</a>
</div>
但是,对于我拥有的 css,只有您悬停在上面的单个跨度会变黑,而短语的其余部分则不会。这是我的CSS:
a.fs-button {
display: inline;
background: #28353e;
height: 26px;
margin: 0 10px;
width: 245px;
float: left;
font-family: 'asenine';
text-decoration: none;
font-size: 20px;
text-align: center;
vertical-align: middle;
padding-top: 5px;
position: absolute;
}
a span.pabout {
color: #f6ec02;
}
.home-buttons a span.labout:hover {
color: black;
}
.home-buttons a span.pabout:hover {
color: black;
}
.home-buttons a.fs-button:hover {
cursor: pointer;
color: black;
font-weight: 500;
background: #f7ed04; /* Old browsers */
background: -moz-linear-gradient(left, #f7ed04 0%, #eda704 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#f7ed04), color-stop(100%,#eda704)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #f7ed04 0%,#eda704 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #f7ed04 0%,#eda704 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #f7ed04 0%,#eda704 100%); /* IE10+ */
background: linear-gradient(to right, #f7ed04 0%,#eda704 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7ed04', endColorstr='#eda704',GradientType=1 ); /* IE6-9 */
}