css自制图书封面效果

先上效果

1 HTML骨架

一张封面,需要有这么几个信息:

1.梗概

2.文章名称

3.作者

4.简介

我们来把这些东西填上去,然后随便编一点数据

html 复制代码
<ul class='items'>
    <li class='item'>
        <div class='item-banner'>
            <div class='item-header'>生活中总是充满了乐趣</div>
            <div class='item-name'>聊聊我的大学室友</div>
            <div class='item-author'>@张三 著</div>
        </div>
        <div class='item-description'>那些回忆,那些事。。。</div>
    </li>
</ul>

当前效果图

2 添加图书封面整体样式

css 复制代码
    .items .item {
            width: 230px;
            height: 320px;
            background: #ccc;
            list-style: none;
            text-align:center;
        }

3 banner部分添加背景色,文字颜色

css 复制代码
.item-banner {
    background: #666;
    color: #FFF;
}

4 header部分的文字调整

css 复制代码
.item-header {
    font-size: 12px;
    line-height: 52px;
}

5 文章名称的样式调整

css 复制代码
.item-name {
    font-size: 22px;
    line-height: 74px;  
}

6 作者区域字体样式调整

css 复制代码
.item-author {
    font-size: 14px;
    text-indent: 7em;
    padding-bottom: 70px;
}

7 简介部分

css 复制代码
.item-description {
    background: #eee;
    height: 104px;
    line-height: 76px;
    text-indent: 3em;
    font-size: 12px;
}

全部代码

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .items .item {
            width: 230px;
            height: 320px;
            background: #ccc;
            list-style: none;
            text-align:center;
        }

        .item-banner {
            background: #666;
            color: #FFF;
        }
        .item-header {
            font-size: 12px;
            line-height: 52px;
        }
        .item-name {
            font-size: 22px;
            line-height: 74px;
        }
        .item-author {
            font-size: 14px;
            text-indent: 7em;
            padding-bottom: 70px;
        }
        .item-description {
            background: #eee;
            height: 104px;
            line-height: 76px;
            text-indent: 3em;
            font-size: 12px;
        }
    </style>
</head>
<body>
<ul class='items'>
    <li class='item'>
        <div class='item-banner'>
            <div class='item-header'>生活中总是充满了乐趣</div>
            <div class='item-name'>聊聊我的大学室友</div>
            <div class='item-author'>@张三 著</div>
        </div>
        <div class='item-description'>那些回忆,那些事。。。</div>
    </li>
</ul>
</body>
</html>
相关推荐
动恰客流统计32 分钟前
景区客流统计怎么做?兼顾管控与运营的实施方案解析
大数据·前端·人工智能
派小心.1 小时前
A/B测试工具免费版够用吗?
前端·数据分析
前端snow2 小时前
ai agent --- redis 缓存
前端
duanshu_3 小时前
官网表单与下载异常怎么排查?五个环节定位故障
前端·自动化·flyweight
Zhou1411363 小时前
SpringBoot_03_Web开发
前端·spring boot·python
辻弋2013 小时前
【无标题】
大数据·服务器·前端·搜索引擎·开源软件
FluxArt4 小时前
GPT Image 2.5 中文提示词教程:Flux Art 可复用模板
前端·gpt·算法
搬砖的小码农_Sky4 小时前
AI Agent:Windows上Node.js安装后 npm -v报错
前端·npm·node.js·人机交互
计算机魔术师5 小时前
半年翻倍!OpenAI再融300亿,估值冲到1.4万亿
前端
研☆香5 小时前
jQuery + Swiper.js 实现动态渲染轮播图
前端·javascript·jquery