2021-09-18

制作一个京东快报(简易版

题目要求:

在这里插入图片描述

创建html文件:

将html与css进行关联:

*1.创建盒子标签(html):*

*创建盒子标签(css):*

按照题目要求

宽度230px,边框宽度为1px,颜色是灰色实线

.box{

border: 1px darkgray solid; 边框宽度为1px,颜色是灰色实线

​ width: 230px; 宽度230px

​ margin: 30px; 外边距30px

​ box-sizing: border-box;}

*2.标题(Html):*

<div class="title">京东快报</div>

*标题(css):*

.title{

​ height: 40px;

​ /* 文字垂直居中 */

​ line-height: 40px;

​ /* 左内边距 */

​ padding-left: 13px;

​ /* 渐变色 */

​ background: linear-gradient(to bottom, #CDCDFF,white);

​ /* 下边框 */

​ border-bottom: 1px dashed gray;

}

3. *内容(html):*

    • [特惠]
    • [公告]
    • [特惠]
    • [公告]
    • Css:

      .list{

      ​ font-size: 12px;

      ​ list-style: none;

      ​ padding: 0px;

      ​ margin: 0px;

      }

      .list li{

      ​ padding-left: 13px;

      ​ padding-right: 13px;

      ​ line-height: 26px; }

      .list a{

      ​ text-decoration: none;

      ​ color: black;}

      .list a:hover{

      ​ color: darkred; }

      *3最后的成果:*
      在这里插入图片描述

      4. *代码:*

      *html:*

      <!DOCTYPE html>
      <html>
      	<head>
      		<meta charset="utf-8" />
      		<title></title>
      		<link rel="stylesheet" type="text/css" href="css/yyds.css" />
      	</head>
      	<body>
      		<div class="box">
      			<div class="title">京东快报</div>
      			<ul class="list">
      				<li><a href="#"><b>[特惠]</b>海飞丝去屑又去油 超清爽</a></li>
      				<li><a href="#"><b>[公告]</b>京东公益支持鲁甸新动作</a></li>
      				<li><a href="#"><b>[特惠]</b>4688元抢iPhone 6</a></li>
      				<li><a href="#"><b>[公告]</b>小米电视携豪礼高调入驻京东</a></li>
      			</ul>
      		</div>
         </body>
      </html>
      

      *Css*

      .box{
      	border: 1px darkgray solid;
      	width: 230px;
      	margin: 30px;
      	box-sizing: border-box;}
      .title{
      	height: 40px;
      	line-height: 40px;
      	padding-left: 13px;
      	background: linear-gradient(to bottom, #CDCDFF,white);
          border-bottom: 1px dashed gray;	}
      .list{
      	font-size: 12px;
      	list-style: none;
      	padding: 0px;
      	margin: 0px;}
      .list li{
      	padding-left: 13px;
      	padding-right: 13px;
      	line-height: 26px;}
      .list a{
      	text-decoration: none;
      	color: black;}
      .list a:hover{
      	color: darkred;}
      
    • 3
      点赞
    • 10
      收藏
      觉得还不错? 一键收藏
    • 1
      评论

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

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

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    抵扣说明:

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

    余额充值