css实现图片悬浮三维倾斜立体效果代码
代码语言:html
所属分类:悬停
代码描述:css实现图片悬浮三维倾斜立体效果代码,可通过style调整参数,全程无js代码。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
img {
--f: .1; /* the parallax factor (the smaller the better) */
--r: 10px; /* radius */
--_f: calc(100%*var(--f)/(1 + var(--f)));
--_a: calc(90deg*var(--f));
width: 250px; /* the image size */
aspect-ratio: calc(1 + var(--f));
object-fit: cover;
clip-path: inset(0 var(--_f) 0 0 round var(--r));
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0