4-3个人程序源码,提供给各位参考!

4-3个人程序源码,提供给各位参考!

4-3个人程序源码,提供给各位参考!(最开始我也不会写,研究了很久别人的源码,才写出来自己这份错漏百出的大作业)

html文件


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>前端页面</title>
    <link  type="text/css" rel="stylesheet" href="css/content.css">
</head>
<body>
<!--页眉和banner区设置-->
<div class="top">
    <div class="top_top">
       <a> <img src="images/logo.png"></a>
        <ul>
            <li><a href="###">CONTACT</a></li>
            <li><a href="###">EVENTS</a></li>
            <li><a href="###">FAULTY</a></li>
            <li><a href="###">GALLERY</a></li>
            <li><a href="###">ABOUT</a></li>
            <li><a href="###">HOME</a></li>
        </ul>
    </div>
    <div class="top_banner">
        <div class="Mask"></div>
        <img src="images/banner3.jpg">
        <div class="text_box">
            <ul>
                <li> <input type="text" name="Name" placeholder="Your Name"></li>
                <li><input type="text" name="Phone" placeholder="Your Phone"></li>
                <li><input type="text" name="Email" placeholder="Your Email"></li>
                <li><textarea  name="Comment">Writter Your Comment Here </textarea></li>
                <li><input type="submit" value="SEND MESSAGE" style="cursor: pointer"></li>
            </ul>
        </div>
    </div>
</div>
<!--about和gallery区设置-->
<div class="middle">
<!--    about上半区域-->
    <div class="middle_top">
        <div class="middle_top_about_upper">
            <h1>ABOUT</h1>
            <P style="color: #07cbc9; font-weight: bold" >——</P>
            <p style="font-size: 10px;line-height:20px">jjasopqn nmqiipirmnc mznbbj wuqu <br>er iifhn dmdhusj dnj dhdg dfdffd<br> gd gdafa dbcj cj</p>
        </div>
        <div class="middle_top_about_lower">
            <div class="middle_top_about_lower_left">
                <div class="middle_top_about_lower_left_upper" style="margin-left: 10px">
                    <h2>A WORD</h2>
                    <h2>ABOUT US</h2>
                </div>
                <div class="middle_top_about_lower_left_lower">
                    <p>CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find, hire and manage great talent.</p>
                    <input type="button" value="EXPLORE"style="cursor: pointer">
                </div>
            </div>
            <div class="middle_top_about_lower_center">
                <img src="images/bb3.jpg">
            </div>
            <div class="middle_top_about_lower_right">
                <div>
                    <h3>70000</h3>
                    <P style="color: #07cbc9; font-weight: bold" >——</P>
                    <p>Students</p>
                </div>
                <div>
                    <h3>6000</h3>
                    <P style="color: #07cbc9; font-weight: bold" >——</P>
                    <p>Faculty</p>
                </div>
            </div>
        </div>
    </div>
<!--    about多图区域-->
    <div class="middle_middle">
        <ul>
            <li><img src="images/b1.jpg"></li>
            <li>
                <div>
                    <p class="p1">Library</p><p class="p2">CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find</p><p class="p3">CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent. CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent.</p>
                    <a href="#"><input type="button" name="" value="EXPLORE" style="cursor: pointer"></a>
                </div>
            </li>
            <li><img src="images/b2.jpg"></li>
            <li>
                <div>
                    <p class="p1">Computer Lab</p><p class="p2">CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find</p><p class="p3">CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent. CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent.</p>
                    <a href="#"><input type="button" name="" value="EXPLORE" style="cursor: pointer"></a>
                </div>
            </li>
            <li>
                <div >
                    <p class="p1" >Conference Hall</p><p class="p2">CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find</p><p class="p3">CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent. CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent.</p>
                    <a href="#"><input type="button" name="" value="EXPLORE" style="cursor: pointer"></a>
                </div>
            </li>
            <li><img src="images/b3.jpg"></li>
            <li>
                <div>
                    <p class="p1">Play Ground</p><p class="p2">CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find</p><p class="p3">CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent. CareerBuilder is a global,end-to-end human capital solutions company focused on helping employers find, hire and manage great talent.</p>
                    <a href="#"><input type="button" name="" value="EXPLORE" style="cursor: pointer"></a>
                </div>
            </li>
            <li><img src="images/b4.jpg"></li>
        </ul>
    </div>
<!--    gallery区-->
    <div class="middle_footer">
<!--        gallery文字区域-->
        <div class="middle_footer_upper">
            <h1>GALLERY</h1>
            <P style="color: #07cbc9; font-weight: bold" >——</P>
            <p style="font-size: 10px;line-height:20px">CareerBuilder is a global, end-to-end human capital solutions company focused on helping employers find</p>
        </div>
<!--    gallery区多图区域    -->
        <div class="middle_footer_lower">
            <ul>
                <li><img src="images/03-01.jpg"><div>SCIENCE LAB</div></li>
                <li><img src="images/03-02.jpg"><div>INDOOR STADIUM</div></li>
                <li><img src="images/03-03.jpg"><div>TIANSPORTATION</div></li>
                <li><img src="images/03-04.jpg"><div>KIDS ROOM</div></li>
                <li><img src="images/03-05.jpg"><div>MEDITATION CLASSES</div></li>
                <li><img src="images/03-06.jpg"><div>KIDS PALY GROUND</div></li>
            </ul>
        </div>
    </div>
</div>
<!--页脚区设置-->
<div class="footer">
    <P>@2016 imooc.com 京ICP备1304667号</P>
</div>
</body>
</html>


css文件


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
/*设置页面的边框、内边距为0 ,字体为Microsoft YaHei UI*/
*{
    margin0;
    padding0;
    font-family"Microsoft YaHei UI";
}
/*去除超链接的下划线,改变字体颜色为黑色*/
a{
    text-decorationnone;
    colorblack;
}
/*改变li的标记样式为无*/
li{
    list-stylenone;
}
/*设置页面fixe 宽度100% 背景色#07cbc9 z-index为100*/
.top_top{
    width:100%;
    /*height: 55px;*/
    positionfixed;
    background-color#07cbc9;
    z-index100;
}
/*设置图片左缩进80px 相对定位 上部缩进5px*/
.top_top img{
    margin-left80px;
    positionrelative;
    top5px;
    /*margin-top: -24px;*/
}
/*menu菜单右浮动 右缩进80px*/
.top_top ul{
    floatright;
    margin-right80px;
}
.top_top ul li{
    floatright;
    list-stylenone;
}
/*设置<a>为块级元素 行高为55px */
.top_top ul li a{
    displayblock;
    colorwhite;
    line-height55px;
    margin-right20px;
}
/*设置鼠标在menu时的浮动效果*/
.top_top ul li a:hover{
    background-colorblack;
    colorwhite;
}
/*html中banner区设置*/
.top .top_banner{
    width100%;
    positionrelative;
    /*margin-top: 55px;*/
    height555px;
    font-size0;
}
/*图片上的半透明遮罩*/
.top_banner .Mask{
    background-colorblack;
    opacity: 0.4;
    height500px;
    width100%;
    positionabsolute;
    top:54px;
    /*多缩进1px 防着页眉和banner中的白线出现*/
    z-index30;
/*设置z_index为30,方便页眉在banner上显示*/
}
.top_banner img{
    margin-top54px;
    height500px;
    width100%;
}
/*对banner上的文本框进行设置*/
.top_banner .text_box{
    positionrelative;
    /*margin: 0 auto;*/
    text-aligncenter;
    top:-500px;
    z-index:50;
    /*background-color: rgba(255,255,255,0.4);*/
}
.top_banner .text_box ul li{
    margin-top30px;
}
/*对banner图片上的文本输入进行相关设置*/
.top_banner .text_box ul li input[type="text"]{
    background-colortransparent;
    /*设置文本框的透明效果*/
    border-stylesolid;
    padding0;
    width20%;
    height25px;
    color: rgba(255,255,255,0.4);
    /*line-height: 25px;*/
    /*text-align: center;*/
}
.top_banner .text_box ul li textarea{
    background-colortransparent;
    border-stylesolid;
    color: rgba(255,255,255,0.4);
    width20%;
    height60px;
    border-width2px;
    /*line-height: 25px;*/
    /*text-align: center;*/
}
/*对banner区submit按钮进行相关设置*/
.top_banner .text_box ul li input[type="submit"]{
    background-colortransparent;
    /*背景透明*/
    border-stylesolid;
    color: rgba(255,255,255,0.4);
    padding8px;
}
/*对banner区文本框、按钮的浮动效果进行设置*/
/*鼠标在文本框上浮动时,文本框变色 */
.top_banner .text_box ul li input:hover{
    border-color#07cbc9;
}
.top_banner .text_box ul li textarea:hover{
    border-color#07cbc9;
}
/*鼠标在submit上浮动时,submit背景色为#07cbc9 无边框 字体为白色*/
.top_banner .text_box ul li input[type="submit"]:hover{
    border-stylenone;
    background-color#07cbc9;
    colorwhite;
}
/*鼠标键入文本框、点击按钮,变色*/
.top_banner .text_box ul li input:focus{
    border-colorblack;
}
.top_banner .text_box ul li textarea:focus{
    border-colorblack;
}
.top_banner .text_box ul li input[type="submit"]:focus{
    border-stylenone;
}
/*middle_top设置*/
.middle_top_about_upper{
    margin30px  auto;
    text-aligncenter;
    height150px;
    width50%;
}
.middle_top_about_lower{
    positionrelative;
    top:-30px;
    height350px;
}
.middle_top_about_lower_left{
    positionrelative;
    /*float: left;*/
    width300px;
    margin0 auto;
    left-270px;
    height300px;
    z-index20;
}
.middle_top_about_lower_left_lower{
    background-color: rgba(255,255,255,0.4);
    /*背景透明*/
    padding15px;
    border1px solid #C0C0C0;
    line-height20px;
}
.middle_top_about_lower_left_lower input{
    margin20px auto;
    padding5px;
    colorwhite;
    background-colorblack;
    border-stylehidden;
}
/*about区按钮悬浮效果*/
.middle_top_about_lower_left_lower input:hover{
    colorblack;
    background-colorwhite;
    border1px solid black;
}
.middle_top_about_lower_center{
    positionrelative;
    width500px;
    margin0 auto;
    text-aligncenter;
    top:-300px
}
.middle_top_about_lower_center img{
    height300px;
    /*width: 360px;*/
}
.middle_top_about_lower_right{
    positionrelative;
    top-550px;
    left340px;
    text-aligncenter;
    width140px;
    margin0 auto;
}
.middle_top_about_lower_right div{
    border1px solid #07cbc9;
    padding10px;
    margin-bottom40px;
}
/*about下半部和gallery设置*/
.middle_middle{
    height740px;
}
.middle_middle ul li{
    width:25%;
    height370px;
    floatleft;
    overflowhidden;
}
.middle_middle ul li img{
    width100%;
    height100%;
}
.middle_middle ul li div{
    padding15px;
    height370px;
    colorwhite;
    background-color#07cbc9;
}
.middle_middle ul li div .p1{
    font-size20px;
    padding-bottom10px;
    line-height30px;
}
.middle_middle ul li div .p2{
    font-size15px;
    padding-bottom10px;
    line-height25px;
}.middle_middle ul li div .p3{
     font-size12px;
     padding-bottom10px;
     line-height20px;
 }
.middle_middle ul li div a{
    displayblock;
    text-aligncenter;
    margin-top30px;
}
.middle_middle ul li div input{
    colorwhite;
    background-colorblack;
    padding10px;
    border-stylehidden;
}
.middle_middle ul li div input:hover{
    background-color: rgba(255,255,255,0);
    colorblack;
    border1px solid black;
}
/**/
.middle_footer_upper{
    positionrelative;
    height100px;
    width300px;
    text-aligncenter;
    margin30px auto;
}
.middle_footer_lower{
    /*text-align: center;*/
    width1140px;
    height650px;
    margin0 auto;
    overflowhidden;
}
.middle_footer_lower ul li{
    floatleft;
    positionrelative;
    right-20px;
    margin-bottom30px;
    margin-right20px;
    font-size0;
}
.middle_footer_lower ul li div{
    /*position: absolute;*/
    height50px;
    colorwhite;
    line-height50px;
    background-colorblack;
    font-size15px;
    text-indent2em;
}
.footer{
    margin-top20px;
    background-color#07cbc9;
    text-aligncenter;
    height50px;
    line-height50px;
}

最后给各位在作业挣扎的同学一点建议:多用position,少用float。懂得margin和top、right、left、bottom的区别。知道text-align:center和margin:0  auto;的区别。一定要分清楚各div(ul和li)块、行元素的层级关系,懂得使用浏览器的F12


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小班 2020-08-13 11:19:02

同学你好,同学的代码完成的不错,题目要求的实现效果也完成了,很棒~

继续加油  祝:学习愉快~

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码