this jsfiddle을 만들었습니다.링크는 Firefox에서는 밑줄이 그어져 있지만 Chrome에서는 그렇지 않습니다
Chrome에서는 의도 한대로 작동하지만 Firefox에서는 링크 아래에 밑줄을 추가하지만 모든 링크에 대해 CSS에는 text-decoration: none
을 명확하게 지정합니다. http://jsfiddle.net/6zbr64fn/
나뿐만 아니라 아래를 포함 :
이
는 바이올린의 코드HTML
<div id="footerSlider">
<div class="fade" id="fade0">
<a href="#">
<table class="footerTable">
<tr>
<td>
<a href="#">
<img class="footerImage" src="http://i.imgur.com/xr54kxd.png">
</a>
</td>
<td>
<span class="footerText">
<a href="#">Something clever</a>
<br>
<div class="footerSublinks">
<a class="footerSublink" href="#">CHOICE 1</a> <span class="split">|</span> <a class="footerSublink" href="#">CHOICE 2</a> <span class="split">|</span> <a class="footerSublink" href="#">CHOICE 3</a>
</div>
</span>
</td>
</tr>
</table>
</a>
</div>
<div class="fade" id="fade1">
<a href="#">
<table class="footerTable">
<tr>
<td>
<a href="#">
<img class="footerImage" src="http://i.imgur.com/du8oCqW.png">
</a>
</td>
<td>
<span class="footerText">
<a href="#">A very nice island</a>
<br>
<div class="footerSublinks">
<a class="footerSublink" href="#">CHOICE 4</a> <span class="split">|</span> <a class="footerSublink" href="#">CHOICE 5</a> <span class="split">|</span> <a class="footerSublink" href="#">CHOICE 6</a>
</div>
</span>
</td>
</tr>
</table>
</a>
</div>
</div>
CSS
#footerSlider {
width: 986px;
height: 168px;
border: 1px solid;
border-radius: 5px;
background-color: #e9e9e9;
}
.fade {
height: 137px;
}
.footerImage {
float: left;
margin-left:20px;
vertical-align:middle;
}
.footerText {
display: table-cell;
vertical-align: middle;
text-align: center;
height: 137px;
}
.footerText > a {
text-decoration: none;
color: #58595b;
font-size: 1.8em;
}
.footerText:before {
content: "";
width: 29px;
height: 26px;
position: absolute;
margin: 8px 0 0 -20px;
background-repeat: no-repeat;
background-image: url(http://i.imgur.com/RpRclne.png);
}
.footerSublinks a {
text-decoration: none;
line-height: 50px;
font-size: 1.7em;
color: #292564;
transition: color 0.8s ease;
}
.footerSublinks a:hover {
text-decoration: underline;
color: #F00;
}
.split {
font-size: 2em;
font-weight: bold;
line-height: 50px;
margin-bottom: 4px;
color: #292564;
}
.footerTable {
text-align: center;
border: 5px;
width: 100%;
margin: 10px;
}
자바 스크립트
var loopInterval = 5000;
$(document).ready(function(){
allFades = $(".fade");
var fadesLength = allFades.length;
var nextIndex = 0;
fadesHtml = [];
allFades.each(function(index){
fadesHtml.push($(this).html());
if(index!=0){
$(this).remove();
}
});
function loopFade(){
$("#fade0").fadeOut(500, function(){
nextIndex++;
if(nextIndex>(fadesLength-1)){
nextIndex=0;
}
$("#fade0").html(fadesHtml[nextIndex]).fadeIn(500);
});
}
setInterval(loopFade, loopInterval);
});
는 텍스트 장식이 아닙니다. 마우스를 가져 가면 밑줄이 빨간색으로 표시되고 파란색 선과 다르게 보입니다. (나는 여전히 주위를 둘러보고있다.) – KnightHawk
코드는'a' 요소를 중첩했다. 이것은 모든 HTML 버전에서 유효하지 않으며 매우 혼란 스럽습니다. 브라우저 동작의 차이점 (오류 복구)을 기대해야합니다. HTML 마크 업을 수정해야합니다. JavaScript가 왜 여기 관련성이 있는지 설명하고 그렇지 않은 경우 JavaScript를 제거해야합니다. –
코멘트 @ JukkaK.Korpela에 대해 고맙습니다. 왜 중첩 된'a' 요소가 유효하지 않습니까? 어떻게하면 배경 전체를 클릭 할 수 있고 (그리고 주소로 이동하게해야합니까?) 그 앞에있는 링크를 클릭 가능하게 만들고 다른 주소를 가리 키기 위해 어떻게해야합니까? – hakermania