호버에서 회전하는이 원이 있지만 중심에 있지 않아 왜 ('원점 변환 중심점'을 추가했는지) 또한 죄송합니다. css에 대해서는 거의 알지 못하지만 2 개의 연속 셀렉터가있을 때 무엇을 의미합니까? 코드 조각이 정말 일어나고 있지만 여기 내 코드를 가질 수 있도록 단지와 무슨 표시되지CSS 회전이 중앙에 있지 않음
#welcome:hover #welcomeavatar{
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
-ms-transform: rotate(180deg); /* IE 9 */
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
transform-origin : center center;
}
#welcome #welcomeavatar{
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
transform-origin : center center;
}
#welcome:hover #speechbubble{
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
margin-left:120px;
}
#welcome #speechbubble{
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#welcome #speechbubble{
-webkit-transition: all 0.7s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
<div id="welcome">
<div id="welcomeavatar"><img src="http://www.for-example.org/img/main/forexamplelogo.png"></div>
<div id="speechbubble"></div>
실제 결과입니다 : 여기
내 코드입니다 www.typhotoshop.tumblr .com시간을내어 주셔서 감사합니다.
회전중인 요소 (#welcomeavatar)가 컨테이너의 전체 너비를 차지하는 표시 : 블록이므로 중심에서 벗어납니다. 204px의 #welcomeavatar에 너비를 추가해보세요. – EricL
사실 #welcomeavatar의 너비와 높이를 200 픽셀 (이미지와 동일)으로 지정해야합니다. 그런 다음 이미지에 스타일을 추가하여 흔들림을 제거해야합니다. 이미지를 표시하려면 높이와 너비를 200px까지 추가하고 블록을 추가하십시오. – EricL
이미지와 #welcomeavatar 요소의 크기가 일치하지 않아 이미지가 사각형이 아니므로 회전 치수를 일치 시키더라도 이음새가 없습니다. 이미지의 자연 해상도가 2630x2565이므로 회전에 약간의 흔들림이 생깁니다. –