2018百度前端技术学院 第五六课 编码作业

2018百度前端技术学院 第五六课 编码作业

一、课程题目

这节课给出了三份文字内容相同的简历,但是样式布局不一样。题目要求我们使用同一份HTML结构内容,三份不同的CSS代码分别实现图片所示的样式,达到HTML结构内容和CSS样式的解耦。

备注要求:

  • 实现时必须保证布局的一致
  • 字体、宽高、边距等不需要完全一致

 二、HTML编写

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/style_3.css">

    <title>百度前端技术学院-day5</title>
</head>

<body>
    <h1>简历</h1>
    <div class="info">
        <div class="header">
            <h2>基本信息</h2>
            <div class="right">
                <span>姓名</span> &emsp;
                <p class="in">张三</p> &emsp;&emsp;
                <span>性别</span> &emsp;
                <p class="in">男</p> &emsp;&emsp;
                <span>应聘职位</span> &emsp;
                <p class="in">Web前端工程师</p>
            </div>
        </div>
        <div class="header">
            <h2>联系方式</h2>
            <div class="right">
                <span>手机</span> &emsp;
                <p class="in">12312341234</p> &emsp;&emsp;
                <span>Email</span> &emsp;
                <p class="in"><a href="#"> joinefe@baidu.com</a></p> &emsp;&emsp;
                <span>个人主页</span> &emsp;
                <p class="in"><a href="#">GitHub</a></p>
            </div>
        </div>
        <div class="header">
            <h2>能力描述</h2>
            <div class="right">
                <span>技术能力</span>
                <p class="in2">熟练掌握HTML,CSS,JavaScript</p>
                <br>
                <span>综合能力</span>
                <p class="in2">良好的沟通,主动积极,努力勤奋</p>
            </div>
        </div>
        <div class="header">
            <h2>教育经历</h2>
            <div class="right">
                <span>本科</span>
                <p class="in2">百度前端技术学院小薇学院</p>
                <br>
                <span>研究生</span>
                <p class="in2">百度前端技术学院大斌学院</p>
            </div>
        </div>
        <div class="header">
            <h2>项目经历</h2>
            <div class="right">
                <span>小度小度</span>
                <p class="in2">作为前端工程师角色参与了ABC组件的开发</p>
                <br>
                <span>SAN Doc</span>
                <p class="in2">作为文档工程师参与了SAN Doc编写</p>
            </div>
        </div>
    </div>

</body>

</html>

三、简历一的CSS编写

.in{
    display: inline;
}

span{
    font-weight: bold;
}

四、简历二的CSS编写 

body,div,dl,dt,dd,ul,li,h1,input,form,a,p,text{
    margin:0;
    padding: 0;
}

h1{
    background-color: #65A5FA;
    color: #ffffff;
    width: 180px;
    height: 700px;
    float: left;
    text-align: center;
    padding-top: 30px;
}

.info{
    width: 900px;
    height: 650px;
    margin-left: 30px;
    float: left;

}

.in{
    display: inline;
}

span{
    font-weight: bold;
}

五、简历三的CSS编写 

body,div,dl,dt,dd,ul,li,h1,input,form,a,p,text{
    margin:0;
    padding: 0;
}

span{
    font-weight: bold;
}

.in{
    display: inline;
}

.in2{
    display: inline;
}

h1{
    width: 1060px;
    height: 100px;
    background-color: #858585;
    color: #ffffff;
    line-height: 100px;
    padding-left: 20px;
}

.header{
    width: 1078px;
    height: 150px;
    border: #D6D6D6 solid 1px;
}

h2{
    width: 148px;
    height: 148px;
    background-color: #D6D6D6;
    float: left;
    margin: 0px;
    text-align: center;
    line-height: 148px;

}

.right{
    float: left;
    margin-top: 10px;
    margin-left: 10px;
}

六、总结 

先分析HTML内容,找出格式相同的内容,思考用什么样的元素组装。(在这一点上我做的很不好,一直觉得有更符合语义化的元素表达,但是始终想不到,大神有更好的方法可以评论区中指出)

再分析三个样式的共同点,寻找可以通用的盒子,最后再编码。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值