HTML与CSS——按钮鼠标悬浮动态效果和按钮自动轮播图(不用JavaScrip( 三 )


CSS总代码
* {text-decoration: none;list-style: none;margin: 0 0;padding: 0 0;}/* 一个盒子大小播放屏幕 */.big-box {width: 400px;height: 60px;position: relative;overflow: hidden;margin: auto;margin-top: 500px;border: 2px solid black;}/* 用来装四个盒子的按钮 *//* .big-box {width: 400px;height: 240px;} */.button-box {position: relative;display: flex;text-align: center;width: 400px;height: 60px;line-height: 60px;animation: move 10s ease 1s infinite;}/* 动画效果轮播效果 */@keyframes move {0% {transform: translate(0, 0px);}33.3% {transform: translate(0, -60px);}66.6% {transform: translate(0, -120px);}100% {transform: translate(0, -180px);}}/* 暂停动画 */.big-box:hover .button-box {animation: none;}/* 按钮效果 */.button1 {margin: auto;width: 80px;height: 40px;border: 2px solid rgb(236, 38, 38);cursor: pointer;transition: all 1.25s;}.button1:hover {background-color: rgb(236, 38, 38);}.button2 {margin: auto;width: 80px;height: 40px;border: 2px solid rgb(109, 109, 252);cursor: pointer;transition: all 1.25s;}.button2:hover {background-color: rgb(109, 109, 252);}.button3 {margin: auto;width: 80px;height: 40px;border: 2px solid rgb(11, 235, 11);cursor: pointer;transition: all 1.25s;}.button3:hover {background-color: rgb(11, 235, 11);}.button4 {margin: auto;width: 80px;height: 40px;border: 2px solid rgb(223, 218, 218);cursor: pointer;transition: all 1.25s;}.button4:hover {background-color: rgb(223, 218, 218);}
如果,大家觉得好的话,可以给我点个赞
谢谢阅读!