HTML+CSS实现——响应式卡片页面

简介: 本篇文章,主要讲解一下如何创建一个响应式卡片页面

本篇文章,主要讲解一下如何创建一个响应式卡片页面


响应式卡片效果图

292e13c427cbed830ae5fdd7ab30b9b.png


HTML部分(index.html)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <link rel="stylesheet" href="style.css">
    <title>响应式卡片</title>
</head>
<link href="http://175.178.184.206/usr/uploads/2022/05/2356336909.png" mce_href="favicon.ico" rel="icon" type="image/x-icon"/>
<body>
    <div class="container">
        <!-- 01 card -->
        <div class="card">
            <div class="circle">
                <h2>Email</h2>
            </div>
            <div class="content">
                <p>Welcome To Mango Diary<br></p>
                <p>Click the button below to tell you what you want to whisper to me</p>
                <a href="#">Post Here</a>
            </div>
        </div>
        <!-- 02 card -->
        <div class="card">
            <div class="circle">
                <h2>Photo</h2>
            </div>
            <div class="content">
                <p>Welcome To Photo Waterfall<br></p>
                <p>Through the days when no one cares, there is poetry and distance</p>
                <a href="#">Read More</a>
            </div>
        </div>
        <!-- 03 card  -->
        <div class="card">
            <div class="circle">
                <h2>Moon</h2>
            </div>
            <div class="content">
                <p>I've always wanted to see the moon from your window. You can see it more clearly in this room than in that one</p>
                <a href="#">Read More</a>
            </div>
        </div>
    </div>
</body>
</html>

CSS部分(style.css)

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap');
* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(45deg,#ffaf00, #bb02ff);
    background-attachment: fixed;
}
.container {
    position: relative;
    width: 1150px;
    padding:20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.container .card {
    position: relative;
    width: 300px;
    height: 480px;
    background: #fff;
    margin: 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 25px rgba(0, 0 ,0 , .2);
    transition: 0.5s;
}
.container:hover .card{
    filter: blur(20px);
    transform: scale(0.9);
    opacity: .5;
}
.container .card:hover{
    filter: blur(0px);
    transform: scale(1.1);
    opacity: 1;
}
.container .card .circle {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    clip-path: circle(180px at center 0);
    text-align: center;
}
.container .card .circle h2{
    color: #fff;
    font-size: 4.5em;
    padding: 30px 0;
}
.container .card .content {
    position: absolute;
    bottom: 10px;
    padding: 20px;
    text-align: center;
} 
.container .card .content p {
    color: #666;
}
.container .card .content a {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    background: #000;
    border-radius: 40px;
    text-decoration: none;
    margin-top: 20px;
    color: #fff;
}
.container .card:nth-child(1) .circle,
.container .card:nth-child(1) .content a{
    background: #ffaf00;
}
.container .card:nth-child(2) .circle,
.container .card:nth-child(2) .content a{
    background: #da2268;
}
.container .card:nth-child(3) .circle,
.container .card:nth-child(3) .content a{
    background: #bb02ff;
}
.container .card:nth-child(4) .circle,
.container .card:nth-child(4) .content a{
    background: #bb02ff;
}
.container .card:nth-child(5) .circle,
.container .card:nth-child(5) .content a{
    background: #bb02ff;
}

注意事项

以上两个文件须使用括号内的名字命名并且放在同一目录下才可

目录
相关文章
|
5天前
|
存储 弹性计算 缓存
阿里云服务器租赁费用:新版租赁收费标准及活动报价参考
本文更新了2026年阿里云全系列云服务器租赁活动报价,所有特惠资源均可前往阿里云活动中心选购,整体覆盖从个人入门到企业级高性能场景的全梯度需求。其中轻量应用服务器主打极致性价比,2核2G峰值200M带宽配置每日10点、15点限时抢购价仅38元/年,2核4G配置379元/年起;高性价比的经济型e实例、通用算力型u2i实例覆盖2核4G至4核32G全档位,适配开发测试与中小型企业业务;搭载英特尔至强6处理器的第九代c9i企业级实例算力较上代提升20%,支撑高并发生产环境,不同实例规格价差清晰,用户可根据自身业务负载与预算灵活选型。
1573 112
|
12天前
|
云安全 人工智能 运维
阿里云联动百位企业安全专家,共识Agent防御最佳实践
当Agent成为新员工,你的安全边界在哪里?
1940 8
阿里云联动百位企业安全专家,共识Agent防御最佳实践
|
6天前
|
人工智能 程序员 API
Codex 接入 DeepSeek-V4-Flash:还能补上识图,提供两套方案
Codex 接入 DeepSeek-V4-Flash 怎么配?本文覆盖 CLI 与桌面端,再用 qwen3-vl-flash 补识图,两套方案可直接照做
|
6天前
|
编解码 人工智能 安全
2核4G/4核8G/8核16G阿里云服务器如何选择实例?经济型e、通用算力型u2i与计算型c9i选哪个?
本文介绍了阿里云2核4G、4核8G、8核16G三档主流配置下经济型e、通用算力型u2i和计算型c9i三种实例的最新活动价格与适用场景。同配置下三者价差显著,以2核4G为例,经济型e低至599.93元/年,计算型c9i则高达1742.08元/年。文章详细解析了各实例的性能定位:经济型e适合轻负载入门场景,u2i兼顾稳定算力与性价比,c9i凭借第9代至强处理器与芯片级安全能力支撑高性能业务。同时提示用户可叠加满减优惠券享受折上折,建议根据业务负载与预算综合决策。
526 112
|
18天前
|
人工智能 前端开发 Linux
Codex 桌面版安装 + CC Switch 接入第三方 API 完整教程(2026 最新)
2026最新教程:手把手教你安装Codex桌面版,通过CC Switch v3.17.0一键接入Fenno等国产API(兼容OpenAI Responses格式),跳过账号登录,完整启用代码审查、多步任务与上下文感知功能。零基础友好,全程图文实操。(239字)
2565 4
|
10天前
|
存储 人工智能 关系型数据库
阿里云AI产品与云产品最新组合套餐:Token Plan、AI coding及云服务器和建站等组合优惠价
阿里云推出全新“算力+模型+应用”一站式云与AI组合套餐活动,覆盖从个人开发者到中大型企业的全场景需求。核心亮点为分三档定价的Token Plan订阅服务,支持Qwen3.8-Max-Preview大模型调用,错峰时段最低可享0.2折优惠。活动同步推出AI Coding、智能体部署、云电脑托管、0代码建站等十余类场景化组合,搭配99元/年的普惠云服务器、88元/年的入门数据库等经典特惠产品,还为企业提供1V1定制化AI转型方案,大幅降低了不同用户群体拥抱AI的技术门槛与采购成本。
721 111
|
20天前
|
人工智能 JSON 安全
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
阿里云AI安全产品联动防御Fastjson攻击
2634 13
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
|
6天前
|
人工智能 JSON Shell
2026AI漫剧本地全开源方案(附各个软件模型链接),8G显卡也能流畅运行
这是一套完全本地化部署的AI漫剧生成技术链路:涵盖LLM剧本分镜生成、FLUX文生图(IP-Adapter人脸锁定)、StoryDiffusion时序连贯控制、LTX-2.3唇形同步视频生成,及ComfyUI全流程调度。零云端费用,仅耗硬件算力,单集2–4小时可产出竖屏短视频,适配抖音/B站分发。
|
7天前
Qoder 一周年 × Qwen3.8-Max 正式上线,多重好礼限时领
8月3日,Qwen3.8-Max 正式上线Qoder,迎来Qoder一周年。新老用户可领800次免费调用,下单再赠2000次;夜间(22:00–08:00)调用5折;邀请好友双方得积分与调用额度。
448 1