css实现旋转相册代码

图片[1]-css实现旋转相册代码-星辰博客

html

<div>
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&1">
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&2">
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&3">
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&4">
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&5">
    <img src="https://api.btstu.cn/sjbz/api.php?method=mobile&6">
</div>

 

css

div {
	width:200px;
	height:400px;
	position:relative;
	margin:500px auto;
}
div img {
	width:200px;
	height:400px;
	position:absolute;
	top:0;
	left:0;
	transition:all 0.6s;
	/* 旋转过度*/
				transform-origin:top right;
	/* 旋转角度*/
}
div:hover img:nth-child(1) {
	transform:rotate(60deg);
}
div:hover img:nth-child(2) {
	transform:rotate(120deg);
}
div:hover img:nth-child(3) {
	transform:rotate(180deg);
}
div:hover img:nth-child(4) {
	transform:rotate(240deg);
}
div:hover img:nth-child(5) {
	transform:rotate(300deg);
}
div:hover img:nth-child(6) {
	transform:rotate(360deg);
}
© 版权声明
THE END
喜欢就支持一下吧
点赞1赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容