- HTML5从入门到精通(第4版)
- 明日科技编著
- 566字
- 2024-12-24 10:26:19
2.4 实践与练习
(答案位置:资源包\TM\sl\2\实践与练习)
一、选择题
1.在HTML语言中,设置页面文字颜色的代码是( )。
A.<body bgcolor=?>
B.<body text=?>
C.<body link=?>
D.<body background=?>
2.在HTML语言中,设置背景颜色的代码是( )。
A.<body bgcolor=?>
B.<body text=?>
C.<body link=?>
D.<body vlink=?>
3.在HTML语言中,( )标签是用于显示网页标题的。
A.<html>
B.<head>
C.<title>
D.<body>
4.在<meta>标签中,name等于( )时表示设置关键字。
A.word
B.words
C.key
D.keywords
5.用HTML语言编写一个简单的网页,网页最基本的结构是( )。
A.<html> <head>…</head> <frame>…</frame> </html>
B.<html> <title>…</title> <body>…</body> </html>
C.<html> <title>…</title> <frame>…</frame> </html>
D.<html> <head>…</head> <body>…</body> </html>
6.若要设计网页的背景图形为bg.jpg,以下标签中,正确的是( )。
A.<body background="bg.jpg">
B.<body bground="bg.jpg">
C.<body image="bg.jpg">
D.<body bgcolor="bg.jpg">
二、判断题
7.在编写HTML的代码时,不可以进行代码的注释。( )
8.HTML的颜色属性值中,Black的代码是""#f00000""。( )
三、填空题
9.头部标签是________________________。
10.元信息标签是________________________。
四、上机题
综合练习1:显示一则程序员笑话 在网页中添加一则程序员笑话,运行效果如图2.39所示。

图2.39 程序员笑话
综合练习2:实现明日学院简介的特色排版 在网页中实现明日学院简介,运行效果如图2.40所示。

图2.40 实现创意排
综合练习3:网页中显示现代诗《面朝大海,春暖花开》 在网页中添加一首现代诗并且设置文字的上边距为20像素,左边距为60像素,效果如图2.41所示。
综合练习4:设置网页中的背景颜色以及文本颜色 在页面中添加现代诗《面朝大海,春暖花开》,并且为页面添加背景图像以及设置文字为白色,如图2.42所示。

图2.41 设置页面边距

图2.42 设置页面的背景图像和文字颜色