css3银河效果

新建一个文件index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body,
        html {
            height: 100%;
            background: url(images/xk.jpg) no-repeat;
            background-size: cover;
            background-color: #222455;
        }

        .wrap {
            width: 600px;
            height: 600px;
            position: fixed;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            /* 	border:3px solid #fff;
	*/
            transform-style: preserve-3d;
        }

        .box01 {
            width: 200px;
            height: 200px;
            position: absolute;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            transform-style: preserve-3d;
            animation: gogogo 10s linear infinite;
        }

        .circle span {
            position: absolute;
            left: 0;
            top: 0;
            width: 200px;
            height: 200px;
            border-radius: 50%;
            border: 1px solid #fcff12;
            box-shadow: 0px 0px 10px rgba(252, 255, 18, 0.5);
        }

        .circle span:nth-child(2) {
            transform: rotateX(40deg);
        }

        .circle span:nth-child(3) {
            transform: rotateX(80deg);
        }

        .circle span:nth-child(4) {
        
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CSS3D旋转效果图是一种利用CSS3的3D变换属性来实现的图形旋转效果。通过使用CSS3的transform属性和perspective属性,可以创建出具有立体感的旋转效果。 要实现CSS3D旋转效果图,可以按照以下步骤进行操作: 1. 创建一个HTML元素,例如一个div容器,用于包裹需要旋转的图形或内容。 2. 使用CSS样式设置该容器的宽度、高度和透视效果。透视效果可以通过perspective属性来设置,例如:`perspective: 1000px;`。 3. 在容器内部创建需要旋转的图形或内容,并使用CSS样式设置其宽度、高度和其他样式属性。 4. 使用CSS3的transform属性来实现旋转效果。可以使用rotateX、rotateY或rotateZ函数来分别实现绕X轴、Y轴或Z轴的旋转。例如:`transform: rotateY(45deg);`。 5. 可以通过添加过渡效果(transition)来使旋转更加平滑。例如:`transition: transform 0.5s ease;`。 下面是一个示例代码,展示了一个简单的CSS3D旋转效果图: ```html <!DOCTYPE html> <html> <head> <style> .container { width: 200px; height: 200px; perspective: 1000px; } .box { width: 100%; height: 100%; background-color: red; transform: rotateY(45deg); transition: transform 0.5s ease; } .container:hover .box { transform: rotateY(180deg); } </style> </head> <body> <div class="container"> <div class="box"></div> </div> </body> </html> ``` 以上代码中,当鼠标悬停在容器上时,盒子会绕Y轴旋转180度。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值