CSDN C1 认证 任务三 -------------web基础与布局


一、任务一、任务二(略)

任务一、任务二主要是引导学生对前端三驾马车进行初识,在此不过多展示任务的完成过程,我们直接来看拓展任务。

二、拓展任务 : CSS盒模型

据说要实现这样的界面?

效果图

在这里插入图片描述

在这里插入图片描述
我主要是用position来做的。
下面附上源代码。

<!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>盒模型布局</title>
    <style>
        html,body{
           width : 100%;
           height : 100%;
        }
         html {
           border-width : 5px;
           border-color : rgb(169,169,169);
           border-style: solid;
        }
        body {
            background-color: rgb(251,220,155);
        }
        .box1 {
            width : 25%;
            height : 280px; 
            font-size: 25px;
            margin-top: 25px;
            text-align: center;
            line-height: 280px;
            margin-left: 35px;
            color : white;
            background-color: rgb(197,208,142);
        }
        .box2 {
            position : absolute;
            font-size: 25px;
            color : white;
            text-align: center;
            top : 35%;
            margin-left: 35px;
            width : 25%;
            height : 590px;
            line-height: 590px;
            background-color: rgb(197,208,142);
        }
        .box3 {
            position : absolute;
            top : 28px;
            left : 550px; 
            font-size : 25px;
            color : white;
            width : 1270px;
            height : 362px;
            line-height: 362px;
            text-align: center;
            background-color: rgb(197,208,142);
        }
        .box4 {
            position : absolute;
            left : -50px; 
            top : -362px;
            width : 572px;
            height : 488px;
            font-size : 25px;
            color : white;
            line-height: 462px;
            text-align: center;
            background-color: rgb(197,208,142);
        }
        .box5 {
            position : absolute;
            left : 1200px; 
            top : 420px;
            width :  620px;
            height : 230px;
            font-size : 25px;
            color : white;
            text-align: center;
            line-height: 230px;
            background-color: rgb(197,208,142);
        }
        .box6 {
            position : absolute;
            left : 1200px; 
            top : 676px;
            width :  620px;
            height : 230px;
            font-size : 25px;
            color : white;
            text-align: center;
            line-height: 230px;
            background-color: rgb(197,208,142);
        }
        .box7 {
            position:absolute;
            top : 120px;
            left : 600px;
            width : 250px;
            height : 200px;
            line-height: 200px;
            text-align: center;
            font-size: 25px;
            color:white;
            background-color: rgb(242,163,99);
        }
        .box8 {
            position: absolute;
            top : -60px;
            left :1500px;
            width : 250px;
            height : 200px;
            line-height: 200px;
            text-align: center;
            font-size: 25px;
            color:white;
            background-color: rgb(242,163,99);
        }
        .box9 {
            position: absolute;
            top : 780px;
            left :600px;
            width : 250px;
            height : 200px;
            line-height: 200px;
            text-align: center;
            font-size: 25px;
            color:white;
            background-color: rgb(242,163,99);
        }
    </style>
</head>
<body>
    <div class = "box1">1</div>
    <div class = "box2">2</div>
    <div class = "box3">3</div>
    <div class = "box9">9<div class ="box4">4</div></div>
    <div class = "box5">5</div>
    <div class = "box6">6</div>
    <div class = "box7">7</div>
    <div class = "box8">8</div>
</body>
</html>

三、自测

  1. HTML5为了使img元素可拖放,需要增加什么属性?
draggable = "true";
  1. HTML5哪一个选择器可以选择一个无时区的日期选择器?

input datetime-local类型

  1. CSS盒子模型中 Margin Border Padding都是什么意思?

margin外边距(不同容器之间的距离),border边框,padding内边距(容器内元素距边框的距离)

  1. 至少说出5种常见的HTML事件

onclick鼠标点击事件 onfocus元素获取焦点事件 onblur失焦事件 onkeydown 按键按下事件
onmousemove鼠标移入事件

  1. HTML的onblur和onfocus是哪种类型的属性?

窗口事件属性

  1. 怎么设置display属性的值使容器成为弹性容器?
display: flex;
  1. JavaScript中有多少种不同类型的循环?

for 、forEach、do…while、while、for…in、for…of

  1. 用户搜索某个单词后,JavaScript高亮显示搜索到的单词,使用哪个语义化标签最合适?

mark标签


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

在森林中麋了鹿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值