. HTML是一种标记语言,它是由(C)解释执行的
A.不需要解释
B.Windows
C.浏览器
D.标记语言处理软件
2.在HTML文档中用于表示页面标题的标记对是(D)
A. <head></head>
B. <header></header>
C. <caption> </caption>
D. <title></title>
3.在HTML文档中用于表示表格的标记对是(C)
A. <head></head>
B.<header></header>
C. <table></table>
D.<caption></caption>
4.在HTML文档中使用的注释符号是(C )。
A. //...
B. /* ....*/
C.<! --.......-->
D.以上都不是
5.为了标识一个HTML文件,应该使用的HTML标记是(C )。
A. <p></p>
B. <head></head>
C. <html></html>
D.<form></form>
6.在下列的HTML中,最大的标题是(D)
A. <h6>
B. <head>
C.<heading>
D.<h1>
7.在HTML中要定义一一个书签,应该使用的语句是(B ) 。
A. <a href="#object_01">text</a>
B. <a name="object _01">text</a>
C. <a target="#object_01">text</a>
D. <a link="#object_ 01" >text</a>
8. 如果要在表单中创建一个普通文本框,下列标记中正确的是( A )。
A. <input type="text" >
B. <input type ="password" >
C. <input type="checkbox" >
D. <input type ="radio" >
9. 下列标记中不属于行内元素的是( D)。
A. <em>
B. <font>
C. <input>
D. <div>
10.下列标记中可以产生粗体字的HTML标记是( C)。
A. <bold>
B. <bb>
C. <b>
D. <i>
11.在下列的HTML中,正确产生超链接的标记是(B)。
A. <a url="http://www. sina. com. cn">新浪网</a>
B. <a href="http://www. sina. com. cn">新浪网</a>
C. <a>http://www. sina. com. cn</a>
D. <a name=" http://www. sina. com. cn" >新浪网</a>
12.以下语句中,正确制作电子邮件链接的是(C)。
A. <a href="xxx@ yyy">
B. <mail href="xxx@ yyy" >
C. <a href="mailto:xxx@ yyy">
D. <mail>xxx@ yyy</ mail>
13.以下选项中,全部都是表格标记的是( B )。
A. <table> <head><tfoot>
B. <table><tr><td>
C. <table><tr><tt>
D. <thead> <body><tr>
14.下列语句中,能产生带有数字列表符号的列表标记是(C)。
A. <ul>
B. <dl>
C. <ol>
D. <list>
15.在下列选项中,正确地产生文本区( textarea)的标记是(A ) 。
A . <textarea>
B. <input type =”textarea" >
C. <input type =”textbox" >
D. <input type="text:">
计算机二级Web(3):HTML语言基础 (下)
计算机二级Web(3):HTML语言基础 (上)
颜色属性被用来设置文字的颜色。
颜色是通过CSS最经常的指定:
一个网页的文本颜色是指在主体内的选择:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
body {
color: blue;
}
h1 {
color: #00ff00;
}
h2 {
color: rgb(255, 0, 0);
}
</style>
</head>
<body>
<h2>hello world</h2>
<h1>welcome to CaoZhou</h1>
</body>
</html>
注:对于W3C标准的CSS:如果你定义了颜色属性,你还必须定义背景色属性。
文本排列属性是用来设置文本的水平对齐方式。
文本可居中或对齐到左或右,两端对齐。
当text-align设置为"justify",每一行被展开为宽度相等,左,右外边距是对齐(如杂志和报纸)。
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
h1 {
text-align: center;
}
p.date {
text-align: right;
}
p.main {
text-align: justify;
}
</style>
</head>
<body>
<p class="date">2015 年 3 月 14 号</p>
<p class="main"> 从前有个书生,和未婚妻约好在某年某月某日结婚。到那一天,未婚妻却嫁给了别人。书生受此打击, 一病不起。 这时,路过一游方僧人,从怀里摸出一面镜子叫书生看。书生看到茫茫大海,一名遇害的女子一丝不挂地躺在海滩上。路过一人, 看一眼,摇摇头,走了。又路过一人,将衣服脱下,给女尸盖上,走了。再路过一人,过去,挖个坑,小心翼翼把尸体掩埋了。 僧人解释道, 那具海滩上的女尸,就是你未婚妻的前世。你是第二个路过的人,曾给过他一件衣服。她今生和你相恋,只为还你一个情。但是她最终要报答一生一世的人,是最后那个把她掩埋的人,那人就是他现在的丈夫。书生大悟,病愈。
</p>
<p><b>注意:</b> 重置浏览器窗口大小查看 "justify" 是如何工作的。</p>
</body>
</html>
text-decoration 属性用来设置或删除文本的装饰。
从设计的角度看 text-decoration属性主要是用来删除链接的下划线:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.none {}
.del {
text-decoration: none;
}
</style>
</head>
<body>
<p>原来的样子</p>
<a href="#" class="none">wwwwwwwwwwwwwwwwww</a>
<p>去掉下划线</p>
<a href="#" class="del">wwwwwwwwwwwwwwwwwwwww</a>
</body>
</html>
也可以这样装饰文字:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
</body>
</html>
注:不建议强调指出不是链接的文本,因为这常常混淆用户。
text-transform文本转换属性是用来指定在一个文本中的大写和小写字母。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
p.uppercase {
text-transform: uppercase;
}
p.lowercase {
text-transform: lowercase;
}
p.capitalize {
text-transform: capitalize;
}
</style>
</head>
<body>
<p class="uppercase">This is some text.</p>
<p class="lowercase">This is some text.</p>
<p class="capitalize">This is some text.</p>
</body>
</html>
text-indent文本缩进属性是用来指定文本的第一行的缩进。
p {text-indent:50px;}
增加或减少字符之间的空间。
<style>
h1 {
letter-spacing:2px;
}
h2 {
letter-spacing:-3px;
}
</style>
指定在一个段落中行之间的空间。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
p.small {
line-height: 70%;
}
p.big {
line-height: 200%;
}
</style>
</head>
<body>
<p>
This is a paragraph with a standard line-height.<br> This is a paragraph with a standard line-height.<br> The default line height in most browsers is about 110% to 120%.<br>
</p>
<p class="small">
This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br>
</p>
<p class="big">
This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br>
</p>
</body>
</html>
增加一个段落中的单词之间的空白空间。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style type="text/css">
p {
word-spacing: 30px;
}
</style>
</head>
<body>
<p>
This is some text. This is some text.
</p>
</body>
</html>
设置文本的垂直对齐图像。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
img{
width: 200px;
height: 100px;
}
img.top {
vertical-align: text-top;
}
img.bottom {
vertical-align: text-bottom;
}
</style>
</head>
<body>
<p>An <img src="img/logo.png" /> image with a default alignment.</p>
<p>An <img class="top" src="img/logo.png" /> image with a text-top alignment.</p>
<p>An <img class="bottom" src="img/logo.png" /> image with a text-bottom alignment.</p>
</body>
</html>
设置文本阴影。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>项目</title>
<style>
h1{
text-shadow: 2px 2px #FF0000;
}
</style>
</head>
<body>
<h1>Text-shadow effect</h1>
</body>
</html>
本文主要介绍了CSS文本样式实际应用中应该如何去操作,通过讲解文本中对应的属性去改变文本的表现形式。使用丰富的效果图的展示,能够更直观的看到运行的效果,能够更好的理解。使用Html语言,代码结构更佳的清晰,能够帮助你更好的学习。
.我们可以在下列哪个 HTML 元素中放置 Javascript 代码?()
A.<script>
B.<javascript>
C.<js>
D.<scripting>
2.写 "Hello World" 的正确 Javascript 语法是?()
A.("Hello World")
B."Hello World"
C.response.write("Hello World")
D.document.write("Hello World")
3.插入 Javacript 的正确位置是?()
A.<body>部分
B.<head>部分
C.<body>部分和<head>部分均可
4.引用名为 "xxx.js" 的外部脚本的正确语法是?()
A.<script src="xxx.js">
B.<script href="xxx.js">
C.<script name="xxx.js">
5.如何在警告框中写入 "Hello World"?()
A.alertBox="Hello World"
B.msgBox("Hello World")
C.alert("Hello World")
D.alertBox("Hello World")
6.如何创建函数?()
A.function:myFunction()
B.function myFunction()
C.function=myFunction()
7.如何调用名为 "myFunction" 的函数?()
A.call function myFunction
B.call myFunction()
C.myFunction()
8.如何编写当 i 等于 5 时执行一些语句的条件语句?()
A.if (i==5)
B.if i=5 then
C.if i=5
D.if i==5 then
9.如何编写当 i 不等于 5 时执行一些语句的条件语句?()
A.if =! 5 then
B.if >< 5
C.if (i >< 5)
D.if (i != 5)
10.在 JavaScript 中,有多少种不同类型的循环?()
A.两种。for 循环和 while 循环。
B.四种。for 循环、while 循环、do...while 循环以及 loop...until 循环。
C.一种。for 循环。
11.for 循环如何开始?()
A.for (i <= 5; i++)
B.for (i = 0; i <= 5; i++)
C.for (i = 0; i <= 5)
D.for i = 1 to 5
12.如何在 JavaScript 中添加注释?()
A.' This is a comment
B.<!--This is a comment-->
C.//This is a comment
13.可插入多行注释的 JavaScript 语法是?()
A./*This comment has more than one line*/
B.//This comment has more than one line//
C.<!--This comment has more than one line-->
14.定义 JavaScript 数组的正确方法是?()
A.var txt = new Array="George","John","Thomas"
B.var txt = new Array(1:"George",2:"John",3:"Thomas")
C.var txt = new Array("George","John","Thomas")
D.var txt = new Array:1=("George")2=("John")3=("Thomas")
15.如何把 7.25 四舍五入为最接近的整数?()
A.round(7.25)
B.rnd(7.25)
C.Math.rnd(7.25)
D.Math.round(7.25)
16.如何求得 2 和 4 中最大的数?()
A.Math.ceil(2,4)
B.Math.max(2,4)
C.ceil(2,4)
D.top(2,4)
17.打开名为 "window2" 的新窗口的 JavaScript 语法是?()
A.open.new("http://www.w3cschool.cn","window2")
B.new.window("http://www.w3cschool.cn","window2")
C.new("http://www.w3cschool.cn","window2")
D.window.open("http://www.w3cschool.cn","window2")
18.如何在浏览器的状态栏放入一条消息?()
A.statusbar = "put your message here"
B.window.status = "put your message here"
C.window.status("put your message here")
D.status("put your message here")
19.如何获得客户端浏览器的名称?()
A.client.navName
B.navigator.appName
C.browser.name
20.外部脚本必须包含 <script> 标签。()
A.正确
B.错误
请把你的答案写在留言区。^_^
*请认真填写需求信息,我们会在24小时内与您取得联系。