资源描述
html阶段试题-A卷
一、 选择题(每题2分,共20道)
1.在一个框架的属性面板中,不能设置下面哪一项。( d )
A.源文件 ; B.边框颜色 ; C.边框宽度 D.图片
2.关于表格的描述正确的一项是。( d )
A.在单元格内不能继续插入整个表格 B.可以同时选定不相邻的单元格
C.粘贴表格时,不粘贴表格的内容 D.在网页中,水平方向(行)可以并排多个独立的单元格(列)
3.关于文本对齐,源代码设置不正确的一项是:( a )
A.居中对齐:<div align="middle">…</div> B.居右对齐:<div align="right">…</div>
C.居左对齐:<div align="left">…</div> D.两端对齐:<div align="justify">…</div>
4. 设置表格字与边框的距离为0的HTML代码是( d)
A. <table cellspacing =0> B. <table height=0>
C. <table border=0> D. <table cellpadding =0>
5.常用的网页图像格式有( c ).
A.gif,tiff B.tiff,jpg C.gif,jpg D.tiff,png
6.CSS样式表不可能实现( d)功能。
A.将格式和结构分离 B.一个CSS文件控制多个网页
C. 控制图片的精确位置 D.兼容所有的浏览器
7.要使表格的边框不显示,应设置border的值是( b)。
A.1 B.0 C.2 D.3
8.为了标识一个HTML文件应该使用的HTML标记是( c)。
A.<p></p> B.<boby></body> C.<html></html> D.<table></table>
9.在HTML中,标记<font>的Size属性最大取值可以是(c )。
A.5 B.6 C.7 D.8
10.下面不属于CSS插入形式的是(a ).
A.索引式 B.内联式 C.嵌入式 D.外部式
11.可以不用发布就能在本地计算机上浏览的页面编写语言是(b )。
A ASP B HTML C PHP D JSP
12.有关网页中的图像的说法不正确的是(c )。
A 网页中的图像并不与网页保存在同一个文件中,每个图像单独保存
B HTML语言可以描述图像的位置、大小等属性
C HTML语言可以直接描述图像上的像素
D 图像可以作为超级链接的起始对象
13.用HTML标记语言编写一个简单的网页,网页最基本的结构是(d )。
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>
14.若要在页面中创建一个图形超链接,要显示的图形为 myhome.jpg,所链接的地址为,以下用法中,正确的是( b );
A <a href=””>myhome.jpg</a>
B <a href=” ”><img src=”myhome.jpg”></a>
C <img src=”myhome.jpg”><a href =””></a>
D <a href =><img src=”myhome.jpg”>
15.用于设置表格背景颜色的属性的是 ( b );
A background B bgcolor C BorderColor D backgroundColor
16.要将页面的当前位置定义成名为”vbpos”的锚,其定义方法正确的是( d )
A.<a href=:vbpos”></a> B.<a href=”#vbpos”>vbpos</a>
C.<a name=vbpos> D.<a name=”vbpos”></a>
17.若要产生一个4行30列的多行文本域,以下方法中,正确的是(c)。
A.<Input type=”text” Rows=”4” Cols=”30” Name=”txtintrol”>
B.<TextArea Rows=”4” Cols=”30” Name=”txtintro”>
C.<TextArea Rows=”4” Cols=”30” Name=”txtintro”></TextArea>
D.<TextArea Rows=”30” Cols=”4” Name=” txtintro”></TextArea>
18.若要在网页中插入样式表main.css,以下用法中,正确的是(a)。
A.<Link href=”main.css” type=text/css rel=stylesheet>
B.<Link Src=”main.css” type=text/css rel=stylesheet>
C.<Link href=”main.css” type=text/css>
D.<Include href=”main.css” type=text/css rel=stylesheet>
19.若要以标题2号字、居中、红色显示”vbscrip”,以下用法中,正确的是(d)
A.<h2><div align=”center”><color=”#ff00000”>vbscript</div></h2></font>
B.<h2><div align=”center”>< font color=”#ff00000”>vbscript</div></h2></font>
C.<h2><div align=”center”><font color=”#ff00000”>vbscript<</h2>/div></font>
D.<h2><div align=”center”>< font color=”#ff00000”>vbscript</font></div></h2>
20. 增加表单的单选框的HTML代码是(c)
A. <input type=submit>
B. <input type=image>
C. <input type=radio>
D. <input type=checkbox>
二、 填空(每题2分,共5题)
1. (主页)通常是用来作为网站的一个欢迎页面或是一个导航页面,是一个网站留给浏览者的最初印象,因而是非常重要的。
2. 在网页中插入背景图案--文件的路径及名称为/img/bg.jpg的语句是(<body background=’/img/bg.jpg’> )。
3.<tr>….</tr>是用来定义(表格的一行);<td>…</td>是用来定义(表格的一列),也叫(单元格);
<th>…</th>是用来定义(表格的标题)。
4.表单对象的名称由(name)属性设定;提交方法由(method)属性指定;若要提交大数据量的数据,则应采用(post)方法;表单提交后的数据处理程序由(action)属性指定。
5.padding和margin常用的用法:
padding:10px; (四边统一内边距)
padding:10px 20px; (上下、左右内边距)
padding:10px 20px 30px 40px; (上、右、下、左内边距)
margin:10px;auto (水平居中,外边距上下边距为10px)
三、案例题:
1. 使用代码设计如下(10分)
答案:
<table border="1" >
<tr>
<td>复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
</tr>
<tr>
<td rowspan="2">复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
<td>复杂表格</td>
</tr>
<tr>
<td colspan="4">复杂表格</td>
</tr>
</table>
2. 使用frameset 设计复合版式,实现如下效果,要求点击左侧菜单页面内蓉的时候打开的页面在右侧主页中显示,如图(5分)
head.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<h1 align="center">头</h1>
</body>
</html
foot.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<h3>联系方式:199999999</h3>
</body>
</html>
left.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<ul>
<li><a href="" target="rightFrame">百度</a></li>
<li><a href="" target="rightFrame">新浪</a></li>
<li><a href="" target="rightFrame">搜狐</a></li>
</ul>
</body>
</html>
right.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<div>欢迎您登陆主页面</div>
</body>
</html>
main.html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<frameset rows="14%,*,12%" bordercolor="#FF0000" border="5">
<frame src="head.html" scrolling="no" />
<frameset cols="20%,*">
<frame src="left.html" scrolling="no" name="leftFrame"/>
<frame src="right.html" scrolling="no" name="rightFrame"/>
</frameset>
<frame src="foot.html" />
</frameset><noframes></noframes>
</html>
3. 由a页面跳转到b页面,a.html在文件夹a中,要求在新建窗口打开b.html页面(5分)
答案:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>a</title>
</head>
<body>
<a href="../b.html" target="_blank"> 连接b.html页面</a>
</body>
</html>
4. 使用盒子浮动制作以下版式logo(10)
答案:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
body {
background:#ccc;
}
.div1{ height:100px; width:600px; margin:30px auto;background:#ff7300; border:10px; border-color:#063;
padding-left:80px;
}
</style>
</head>
<body>
<div class="div1">
<div id="logo"><img src="images/logo.jpg" alt="logo"/>
</div>
</body>
</html>
5. 设计贵美登录页面,主要测试学生掌握form表单的情况,要求设计注册页面register.html和主页登录的页面index.html,用户输入注册页面的信息要求跳转到主页,要求请求方式是post请求。(10分)
注册页面
登录页面
答案:
<body>
<h4>阅读贵美网服务协议 </h4>
<textarea name="textarea" cols="35" rows="15">欢迎阅读服务条款协议,本协议阐述之条款和条件适用于您使用G网站的各种工具和服务。
本服务协议双方为贵美与贵美网用户,本服务协议具有合同效力。
贵美的权利和义务
1.贵美有义务在现有技术上维护整个网上交易平台的正常运行,并努力提升和改进技术,使用户网上交易活动的顺利。
2.对用户在注册使用贵美网上交易平台中所遇到的与交易或注册有关的问题及反映的情况,贵美应及时作出回复。
3.对于在贵美网网上交易平台上的不当行为或其它任何贵美认为应当终止服务的情况,贵美有权随时作出删除相关信息、终止服务提供等处理,而无须征得用户的同意。
4.因网上交易平台的特殊性,贵美没有义务对所有用户的注册资料、所有的交易行为以及与交易有关的其他事项进行事先审查。
</textarea>
<hr />
<hr />
<form acton="index.html" method="post" >
<table>
<tr>
<td>
登陆名(账号):
</td>
<td>
<input name="name" type="text" />
</td>
</tr>
<tr>
<td>
密码:
</td>
<td>
<input name="password" type="password" />(至少包含 6 个字符)
</td>
</tr>
<tr>
<td>
重复输入密码:
</td>
<td>
<input name="rpass" type="password" />
</td>
</tr>
<tr>
<td>
电子邮箱:
</td>
<td>
<input name="email" type="text" />(必须包含 @ 字符)
</td>
</tr>
<tr>
<td>
性别:
</td>
<td>
<input name="gender" id="gender" type="radio" value="男" checked="checked" />
男
<input name="gender" class="b0" type="radio" value="女" />
女
</td>
</tr>
<tr>
<td>
上传头像:
</td>
<td>
<input type="file" />
</td>
</tr>
<tr>
<td>
爱好:
</td>
<td>
<input type="checkbox" name="hobby" id="hobby" value="checkbox" /> 运动
<input type="checkbox" name="hobby2" value="checkbox" /> 聊天
<input type="checkbox" name="hobby3" value="checkbox" /> 玩游戏
</td>
</tr>
<tr>
<td>
出生日期:
</td>
<td>
<input name="nYear" id="nYear" class="w40" value="yyyy" maxlength="4" /> 年
<select name="nMonth">
<option value="" selected="selected">[选择月份]</option>
<option value="0">一月</option>
<option value="1">二月</option>
<option value="2">三月</option>
<option value="3">四月</option>
<option value="4">五月</option>
<option value="5">六月</option>
<option value="6">七月</option>
<option value="7">八月</option>
<option value="8">九月</option>
<option value="9">十月</option>
<option value="10">十一月</option>
<option value="11">十二月</option>
</select>
<input name="nDay" value="dd" maxlength="2" />日
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="提交" />
</td>
<td>
<input type="reset" name="reset" value="重置"/>
</td>
</tr>
</table>
</form>
</body>
6. 讲一下盒子的属性的几种关键属性,要求画出在某一个div中盒子的几种属性的模型图,如何定位外边距、边框和内边距,各个属性在css里面的样式设置的几种方向,有几种参数可以定位div及div里面的元素和他的边框。要求画出原理图,阐述定位外边距和内边距及边框的样式及定位的方法。(10)
答案:
原理图
设置div的外边距的方法:
外边距:
margin
margin-top
margin-right
margin-bottom
margin-left
margin:上,右,下,左
margin:上下,左右
margin:0px auto; 自动居中
如
margin:1px,2px,3px,4px;
margin:1px,2px;
margin:0px auto ;
margin-left:1px;
内边距:
padding属性
padding
padding-top
padding-right
padding-bottom
padding-left
padding-left : 5px;
padding: 上,右,下,左
padding: 上下,左右
padding: 5px 10px 20px 40px
padding: 5px 10px
边框:
border-color
border-width
border-style
如:
border-style: none; (样式)
border: 1px solid red;(线宽1 线型实线 颜色红色)
展开阅读全文