div+css实现卡片电影海报悬浮显示更多信息效果代码
代码语言:html
所属分类:悬停
代码描述:div+css实现卡片电影海报悬浮显示更多信息效果代码,显示了电影名称及上映年份、主演、评分标签介绍等信息。
代码标签: div css 卡片 电影 海报 悬浮 显示 更多 信息
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: Inter, sans-serif;
        }
        
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background: #f5f5f5;
        }
        
        .wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            padding: 20px;
            display: flex;
            align-content: center;
            justify-content: center;
            gap: 24px;
            flex-wrap: wrap;
        }
        
        .card {
            position: relative;
            width: 325px;
            height: 450px;
            background: #000;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        }
        
        .poster {
            position: relative;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        
        .poster::before {
            content: '';
            position: absolute;
            bottom: -45%;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            transition: .3s;
        }
        
        .card:hover .poster::before {
            bottom: 0;
        }
        
        .poster img {
            position: absolute;
            top: 0;
         .........完整代码请登录后点击上方下载按钮下载查看
















			
			
				
			
	
网友评论0