小白程序员第五天

网页新闻界面建立

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>娱乐新闻</title>

    <style>

        body{

            background-color:silver;

        }

        /*去除下划线*/

        a{

            text-decoration: none;

        }

        .news-wrapper{

            /*设置宽度*/

            width: 350px;

            /*设置高度*/

            height: 357px;

            /*设置背景颜色*/

            background-color:#fff;

            /*设置上边框*/

            border-top: 1px #ddd solid;

            margin: 50px auto;

        }

   

        .news-title{

            /*将行内元素转成行内块,为了使边框和文字一样宽*/

            display: inline-block;

            /*设置上边框*/

            border-top: 1px red solid;

            /*设置上边框上移,盖住灰色边框*/

            margin-top: -1px;  

            /*设置高度*/        

            height: 40px;

            /*文字垂直居中*/

            line-height: 40px;

        }

        /*设置title中的超链接的样式*/

        .news-title a{

            /*设置文字大小*/

            font-size: 16px;

            /*设置文字颜色*/

            color: #40406B;

            /*文字加粗*/

            font-weight: bold;

        }

     

        .news-title a:hover{

            color: red;

        }

        /*设置图片容器高度*/

        .news-img{

            height: 100px;

        }

        .news-img .img-title{

            /*上移文字*/

            margin-top: -30px;

            /*文字右移*/

            margin-left: 25px;

            /*设置字体颜色*/

            color:whitesmoke;

            /*设置字体加粗*/

            font-weight: bold;          

        }

     

        .news-list{

            margin-top: 20px;

        }

        /*设置li*/

        .news-list li{

            margin-bottom: 20px;        

        }

        /*设置li中的文字样式*/

        .news-list li a{

            /*设置字体大小、颜色*/

            font-size: 14px;

            color: gray;

        }

        /*设置鼠标超链接移入状态*/

        .news-list li a:hover{

            color: red;

        }

     

        .news-list li::before{

            /*添加项目符号*/

            content: "■";

            /*设置颜色大小边距*/

            color: rgb(218,218,218);

            font-size: 12px;

            margin-right: 4px;

        }

    </style>

</head>

<body>

    <div class="news-wrapper">

        <!--创建标题标签-->

        <h2 class="news-title"><a href="#">娱乐</a></h2>

        <!--创建图片容器-->

        <div class="news-img">

            <a href="#">

                <img src="2.PNG" alt="">

                <h3 class="img-title"> <span>#</span> </h3>

            </a>

        </div>

        <!--新闻列表-->

        <ul class="news-list">

            <li><a href="#">黄宗泽餐厅宣布停业&nbsp;损失超百万</a></li>

            <li><a href="#">张凯丽:演员不要急功近利,要有真材实料</a></li>

            <li><a href="#">网曝杨洋蜡像被年轻女子骚扰</a></li>

            <li><a href="#">丁太昇吐槽郭敬明抄袭 言语粗俗被骂</a></li>

        </ul>

    </div>  

</body>

</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值