新闻列表 新闻模块无序列表

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新闻列表</title>
    <link rel="stylesheet" href="public.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
<!--全部内容-->
<div class="news_l">
    <!--标题-->
    <div class="news_tit">
        <img src="image/2.png" height="26" width="125"/></div>
    <!--标题end-->
    <!--列表内容-->
    <ul class="news_list">
            <li>
                <a href="#" target="_blank">
                    学府悦园公租房项目A、B、C区部分商业用房整体招标结果公告</a>
                    <span>2020-10-29</span>
                <hr width="622px" style
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的新闻列表页的示例代码: HTML代码: ```html <!DOCTYPE html> <html> <head> <title>新闻列表页</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="style.css"> </head> <body> <header> <h1>今日头条</h1> <nav> <ul> <li><a href="#">新闻</a></li> <li><a href="#">娱乐</a></li> <li><a href="#">体育</a></li> <li><a href="#">科技</a></li> </ul> </nav> </header> <main> <section> <h2>最新新闻</h2> <ul> <li> <a href="#"> <h3>标题一</h3> <p>新闻简介一</p> <span>2021-07-01</span> </a> </li> <li> <a href="#"> <h3>标题二</h3> <p>新闻简介二</p> <span>2021-07-02</span> </a> </li> <li> <a href="#"> <h3>标题三</h3> <p>新闻简介三</p> <span>2021-07-03</span> </a> </li> <!-- 添加更多新闻条目 --> </ul> </section> </main> <footer> <p>版权所有 © 2021 今日头条</p> </footer> </body> </html> ``` CSS代码: ```css /* 重置默认样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } /* 设置页面背景色和字体 */ body { background-color: #f5f5f5; font-family: Arial, sans-serif; } /* 设置页眉样式 */ header { background-color: #333; color: #fff; padding: 20px; } /* 设置页眉标题样式 */ header h1 { font-size: 32px; font-weight: bold; margin: 0; } /* 设置页眉导航样式 */ nav ul { list-style: none; display: flex; } nav li { margin-right: 20px; } nav a { color: #fff; text-decoration: none; font-size: 18px; } /* 设置主要内容样式 */ main { padding: 20px; } /* 设置新闻列表样式 */ section { margin-bottom: 20px; } section h2 { font-size: 24px; font-weight: bold; margin-bottom: 10px; } section ul { list-style: none; } section li { margin-bottom: 20px; background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } section li a { color: #333; text-decoration: none; } section li a:hover { text-decoration: underline; } section li h3 { font-size: 20px; font-weight: bold; margin-bottom: 5px; } section li p { font-size: 16px; margin-bottom: 10px; } section li span { display: block; font-size: 14px; color: #999; } ``` 该示例代码包括一个页眉和一个主要内容区域,主要内容区域包含一个新闻列表部分。新闻列表部分包括一个标题和一个无序列表,每个列表项包括一个标题、一段简介和日期。在实际应用中,可以从数据库或API中获取新闻数据并动态生成页面内容。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值