css实现个人资料卡片悬浮展开动画效果代码
代码语言:html
所属分类:悬停
代码描述:css实现个人资料卡片悬浮展开动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <style> @import url('https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900'); * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(45deg, #fbda61, #ff5acd); } .card { position: relative; width: 350px; height: 190px; /* height: 450px; */ background: #fff; border-radius: 20px; box-shadow: 0 35px 80px rgba(0, 0, 0, 0.15); transition: 0.5s; } .card:hover { height: 450px; } .imgBx { position: absolute; left: 50%; top: -50px; transform: translateX(-50%); width: 150px; height: 150px; background: #fff; border-radius: 20px; box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35); overflow: hidden; transition: 0.5s; } .card:hover .imgBx { width: 250px; height: 250px; } .imgBx img{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .card .content { position: absolute; width: 100%; height: 100%; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; } .card .content .details { padding: 40px; text-align: center; width: 100%; transition: 0.5s; transform: translateY(150px); } .card:hover .content .details { transform: translateY(0px); } .card .content .details h2 { font-size: 1.25em; font-weight: 600; color: #555; line-height: 1.2em; } .card .content .details h2 span { font-size: 0.75em; font-weight: 500; opacity: 0.5; } .card .content .details .data { display.........完整代码请登录后点击上方下载按钮下载查看
网友评论0