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>
相关推荐
pan_junbiao2 小时前
Go 语言基本数据类型
java·前端·golang
ZhengEnCi10 小时前
前端日志和后端日志怎么记:分级、JSON 格式、按天分文件与保留策略
前端·后端·python
kyriewen11 小时前
我给 61 个前端库排了两次名,最多差了 46 位
前端·javascript·程序员
亲亲小宝宝鸭12 小时前
Cesium启动:TLE数据是如何变成轨迹线的
前端·cesium
阿里云云原生12 小时前
对话即构建,在 AgentCore 构建 Agent 就是这么简单
前端·agent
夕水12 小时前
我给我的诗写了个后台,顺手写了 一个组件库ew-solid-ui
前端·javascript·typescript
狗头大军之江苏分军13 小时前
前端转行干能干什么?我转行试了下(被迫)
前端·后端
孟陬13 小时前
Foobar 技术周刊#2:约会已死?用户急剧下滑,约会App大概率会弱化约会属性转向轻陪伴。我有个建议:
前端·后端·rust
parade岁月14 小时前
VTable Guild 3.0.0 发布,面向 Vue 3 的 ProTable 式业务表格
前端
xurileidian14 小时前
第 17 篇 · 边玩边学Python · for 遍历 enumerate 与 zip
java·前端·python