Question 1 examines the title tag
#
Question 2 examines the essence of HTML
##Answer: D
Analysis: First of all, HTML only relies on tag pairs to express semantics, and it has nothing to do with whether it is indented or newline; as long as the tags have the correct nesting relationship and the correct parent-child relationship, then It is a legal HTML structure and does not necessarily need to be indented. Baidu's homepage, in order to reduce the file size, is not indented. When it comes to the role of HTML, we can only think about it in terms of semantics, never in terms of style. So C is wrong. D is correct.
Question 3 Examine common attributes
Answer: D.
This question mainly tests the tags for inserting pictures and hyperlinks. These two sentences are relatively easy to remember. It is best for everyone to remember some commonly used tag sentences.
1 <img src="1.jpg" / alt="Sharing small exercises suitable for novices in html" > 2 3 <a href="1.html">点击我</a>
img is image "image";
src is source "resource";
a is anchor "anchor";
href is hypertext reference "hypertext address"
Question 4 examines the principles of HTTP
Answer: B.
There are some files on the server, such as html, pictures, css, and js files, which are transferred to the user's computer through HTTP requests. Therefore, on the second visit, these images do not need to be transferred, so the page becomes faster.
A, wrong, there is no so-called VIP channel.
B, correct
C, incorrect. Because HTTP is not a persistent connection protocol, it is pulled down after transmission and the connection is closed, so there is no continuous path.
D, error. Each visit is a different addressing process, and the path will not be "recorded".
Question 5 Plain text
答案:C。
用记事本打开,不是乱码,是可读的,那么一定是纯本文文件。只有文本,没有样式,没有语义。
所以,.java文件是纯文本的,.class文件不是纯文本的。
所有的纯文本文件都能用记事本、notepad++、editplus、sublime编辑。
第6题 考察XHTML
答案:B。
所有的标签名、属性都要小写,必须使用引号,必须封闭。答案是B
第7题 考察定义列表
答案:B。
一定要记住每个标签标示什么,就是英语原意是什么?比如
dl 就是definition list, 定义列表;
dt 就是definition title,定义标题;
dd就是definition description,定义描述
第8题 考察相对路径
1.html中,有一个能够点击的图片。所以骨架:
1 <a href=""><img src="" / alt="Sharing small exercises suitable for novices in html" ></a>
href里面是相对路径,要从1.html出发找到2.html;
src里面也是相对路径,要从1.html出发找到kaola.png。
标准答案:
1 <a href="../myweb2/2.html" target="_blank"><img src="../../photo/kaola.png" / alt="Sharing small exercises suitable for novices in html" ></a>
我们一直在用的是相对路径,就是从自己出发找到别人。用相对路径的好处很明显,就是站点文件夹可以拷着走。
相对路径的好处:站点不管拷贝到哪里,文件和图片的相对路径关系都是不变的。
相对路径使用有一个前提,就是网页文件和你的图片,必须在一个服务器上。
比如,你现在想插入一个新浪网上的图片,那么就不能用相对路径。就要用绝对路径。
绝对路径非常简单,所有以http://开头的路径,就是绝对路径。
<img src="http://i1.sinaimg.cn/dy/deco/2013/0329/logo/LOGO_1x.png" alt="" /> <a href="http://www.sohu.com">点击我跳转到搜狐</a>
如果我的网页在C盘,图片却在D盘,能不能插入呢?
答案:用相对路径不能,用绝对路径也不能。
注意,可以使用file://来插入,但是这种方法,没有任何意义!因为服务器上没有所谓c盘、d盘。
下面的方法是行的,但是没有任何工程上的意义,这是因为服务器没有盘符,linux系统没有盘符,
<img src="file://C:\Users\Danny\Pictures\ 明星 \1.jpg" alt="" />
总结一下:
我们现在无论是在a标签、img标签,如果要用路径。只有两种路径能用,就是相对路径和绝对路径。
相对路径,就是../ image/ 这种路径。从自己出发,找到别人;
绝对路径,就是http://开头的路径。
绝对不允许使用file://开头的东西,这个是完全错误的!!
The above is the detailed content of Sharing small exercises suitable for novices in html. For more information, please follow other related articles on the PHP Chinese website!