css图文卡片点击图片放大效果代码

代码语言:html

所属分类:图片放大

代码描述:css图文卡片点击图片放大效果代码

代码标签: css 图文 卡片 点击 图片 放大

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        * {
        	padding: 0;
        	margin: 0;
        	box-sizing: border-box;
        }
        body {
        	min-height: 100vh;
        	display: grid;
        	place-items: center;
        	font-size: 16pt;
        	color: #1a1a1a;
        	background: #fffffa;
        }
        
        .card {
        	position: relative;
        	width: max(50vw, 350px - 3vw);
        	height: 60vmin;
        	background: #f7f3d5;
        	border: 1px solid #433f0e;
        	border-radius: 15px;
        	box-shadow: 15px 15px 37px -10px #7e7e7e;
         	overflow: hidden;
        }
        .card:hover {cursor: pointer;}
        
        .text-holder {
        	width: 60%;
        	margin: clamp(1rem, 6%, 3rem);
        }
        h1, p {
        	margin-bottom: clamp(.5rem, 2%, 1rem);
        	transition: transform .4s ease-in-out, opacity .4s ease-in-out;
        }
        h1 {
        	font-size: clamp(1.5rem, 5vw, 2.5rem);
        }
        p {
        	font-size: clamp(1rem, 4vw, 1.5rem);
        }
        .toggled p, .toggled h1 {
        	transform: translateY(100px);
        	opacity: 0;
        }
        
        .image-holder {
        	position: absolute;
        	top: 50%;
        	right: 1rem;
        	transform: translateY(-50%);
        	width: 20%;
        	height: 90%;
        	background-image: url(//repo.bfw.wi.........完整代码请登录后点击上方下载按钮下载查看

网友评论0