用html和css制作图片集

图片集

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">
    <title>Document</title>
    <link rel="stylesheet" href="test3.css">
</head>

<body>
    <div class="box">
        <div class="content">
            <h3>
                <span class="span1">新闻动态</span>
                <a class="a1" href="#">more+</a>
            </h3>
            <ul>
                <a href="#">
                    <li>
                        <img src="img1.jpg" alt="无法显示">
                        <h4>军训专题</h4>
                        <p>“中国近代科学社团史研究:史料、视角及方法”学术研讨会于2021年6月27日至28日在河北大学五四路校区举行。来自清华大学、同济大学、</p>
                    </li>
                </a>
                <a href="#">
                    <li>
                        <img src="img1.jpg" alt="无法显示">
                        <h4>军训专题</h4>
                        <p>中央财经大学、中国农业大学、东华大学、西北大学、天津大学、江苏师范大学、山西师范大学、内蒙古师范大学、河北大学、</p>
                    </li>
                </a>
                <a href="#">
                    <li>
                        <img src="img1.jpg" alt="无法显示">
                        <h4>军训专题</h4>
                        <p>开幕式上,历史学院院长肖红松教授首先致辞,向与会学者表示欢迎,并向与会专家学者介绍了历史学院的发展历程、学科特色及成就;</p>
                    </li>
                </a>
                <a href="#">
                    <li>
                        <img src="img1.jpg" alt="无法显示">
                        <h4>军训专题</h4>
                        <p>开幕式结束后进入主题报告,由东华大学教授仪德刚主持。北京大学张大庆教授、同济大学万立明教授、天津大学陈印政副研究员、</p>
                    </li>
                </a>
            </ul>
        </div>
    </div>
</body>

</html>

css代码

* {
    margin: 0;
    padding: 0;
}

.box {
    margin-top: 100px;
    width: 100%;
    height: 500px;
    background-color: rgb(243, 243, 243);
}

.content {
    margin: auto;
    width: 80%;
    height: 400px;
    background-color: rgb(243, 243, 243);
}

.content h3 {
    border-bottom: 1px solid rgb(221, 221, 221);
    height: 35px;
}

.span1 {
    border-bottom: 1px solid rgb(217, 49, 36);
    padding-bottom: 10px;
}

.a1 {
    float: right;
    color: rgb(170, 170, 170);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.box .content ul li {
    float: left;
    width: 23%;
    margin: 15px 1%;
    display: block;
    text-decoration: none;
}

.box .content ul li img {
    width: 100%;
}

.box .content ul li h4 {
    margin-top: 10px;
    font-weight: 500;
    color: rgb(217, 49, 36);
}

.box .content ul li p {
    margin-top: 10px;
    color: #999;
    font-size: 14px;
    font-weight: 500px;
}

.box .content ul a p:hover {
    color: rgb(217, 49, 36);
}

最终效果

在这里插入图片描述

  • 6
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值