您的位置:首页技术文章
文章详情页

css3像卷轴一样展开

浏览:41日期:2023-08-12 15:18:26

问题描述

请问如何让一个元素从中间开始向两边展开?像卷轴一样?

问题解答

回答1:

刚才想了下,最简单的使用position的left和right就能实现

.map{ height:100px; background:url('https://sf-static.b0.upaiyun.com/v-5798d230/global/img/logo-b.svg') center center no-repeat; animation:spread 5s linear forwards; position:absolute; left:50%; right:50%; text-align:center;}@keyframes spread{ form{} to{left:0;right:0;}}

标签: CSS
相关文章: