잠시 동안 내 웹 사이트에서이 문제가 발생하여 그림을 사용하여 머리글 작업을하고 있었고 그 위로 마우스를 가져 가면 그림이 바뀌지 만 끝나면 그림이 바뀝니다.CSS 헤더 이미지 "스택 됨"
CSS의 코딩 : "홈", "뉴스", "로그인", "등록"과 "연락처"퍼팅, 내가 대신 서로 옆에 모두의, 모두는 다음과 같이 최대 스택 것으로 나타났습니다 : #menubar { 너비 : 50 %; 여백 : 0 자동 0 자동;
.home {
display: block;
width: 240px;
height: 100px;
background: url('IMG/Heading_Normal_and_Hover.png');
background-position: 0 0;
}
.home:hover {
background-position: 0 100;
}
/***************************************************/
.news {
display: block;
width: 240px;
height: 100px;
background: url('IMG/Heading_Normal_and_Hover.png');
background-position: -240 top;
}
.news:hover {
background-position: -240 bottom;
}
/***************************************************/
.register {
display: block;
width: 240px;
height: 100px;
background: url('IMG/Heading_Normal_and_Hover.png');
background-position: 480 top ;
}
.register:hover {
background-position: 480 bottom;
}
/***************************************************/
.play { /*login*/
display: block;
width: 240px;
height: 100px;
background: url('IMG/Heading_Normal_and_Hover.png');
background-position: 720 top;
}
.play:hover {
background-position: 720 bottom;
}
/***************************************************/
.contact {
display: block;
width: 240px;
height: 100px;
background: url('IMG/Heading_Normal_and_Hover.png');
background-position: 240 top ;
}
.contact:hover {
background-position: 240 bottom;
}
/***************************************************/
}
귀하의 문제는 일반적으로 그 원인이되는 unfloated, 서로가 서로 (대신 서로 옆에) 위에 쌓인하려면 옆에 여러 블록 요소 목록에서 유래
당신은 [jsFiddle] (http://jsfiddle.net/)이 재현 할 수 있습니까? – brandonscript
'.home, .news, .register, .play, .contact {float : left; }'에 추가하고'background-position'에 숫자 옆에'px'를 추가하십시오. – mdesdev
@ r3mus 간단한 솔루션을 선호합니다 ( – ToontownFred