상대 객체 옆에 절대 객체를 배치하려고합니다. 초기 개체는 상대 div가 다음 줄로 줄 이도록합니다.상대방을 따라 절대 div 위치 지정
타이틀이 새로운 "라인"으로 이동하도록 강요하는 것을 제외하고는 모든 것이 정상적으로 작동합니다. #logo div를 position:absolute
으로 변경하면 위치 확인 문제를 해결할 수 있지만 로고가 제대로 작동하지 않습니다.
편집 : http://vaer.ca/warm-forest-8234/ 다음
내 HTML입니다 : 여기에 라이브 데모의
#container {
width: 980px;
margin: 0 auto;
position: relative;
}
#header {
height: 75px;
text-align: right;
position: relative;
}
#header h2 {
font-size: 2.5em;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 0.1em;
padding-top: 15px;
}
#header a {
text-decoration: none;
color: #000000;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
transition:.5s;
}
#header a:hover {
color: #7acfdd;
}
#logo {
position: relative;
display: block;
margin-top: 10px;
margin-left: 10px;
background: url('../img/logo.png') no-repeat;
width: 60px;
height: 60px;
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
transition:.5s;
}
#logo:hover {
position: relative;
background: url('../img/logo-hover.png') no-repeat;
}
당신의 위치를 사용할 때 여전히 물체를 떠있을 수 있습니다 : relative; – Ivo