我有2個元素這樣的:元素邊框旋轉
<div class="element"><span></span></div>
元素必須有邊框圓角(CSS)和懸停邊界必須虛線(CSS)和旋轉,但跨度shoulde是靜態的。任何幫助?
@keyframes rotate {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
@-moz-keyframes rotate {
from {
-moz-transform: rotate(0);
}
to {
-moz-transform: rotate(360deg);
}
}
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0);
}
to {
-webkit-transform: rotate(360deg);
}
}
.element {
width: 40px;
height: 40px;
background: #ededed;
color: @fff;
}
.element:hover {
animation: rotate 2s infinite linear;
-moz-animation: rotate 2s infinite linear;
-webkit-animation: rotate 2s infinite linear;
}
<div class="element"><span>1</span>
</div>
你是什麼意思的旋轉?你的意思是邊界的破折號應該圍繞元素移動嗎? – Andy
邊框中的破折號應該圍繞元素移動,是的。 –
這是測試代碼。我如何得到,該跨度不移動div? –