Sharing small exercises suitable for novices in html

黄舟
Release: 2018-05-12 10:48:44
Original
6368 people have browsed it

Question 1 examines the title tag

Sharing small exercises suitable for novices in html

Sharing small exercises suitable for novices in html

#

appears in inside head<span style="font-family:'楷体', '楷体_GB2312', SimKai;">></span> represents the title of the page. Visually, we can see it in the title bar (tab bar) of the browser. <span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span><span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span>BCorrect. <p><span style="font-family:'楷体', '楷体_GB2312', SimKai;"> </span></p> <p>Question 2 examines the essence of HTML</p> <p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span></p> <p>##Answer: D<img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/e3fe2b8b2b3caf68d46305ba97da9901-2.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"></p> <p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;"> 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. </span></p> <p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">Question 3 Examine common attributes</span></p> <p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span></p> <p>Answer: D. <img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/e3fe2b8b2b3caf68d46305ba97da9901-3.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"></p> <p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">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. </span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">1 <img src="1.jpg" / alt="Sharing small exercises suitable for novices in html" > 2 3 <a href="1.html">点击我</a></pre><div class="contentsignin">Copy after login</div></div><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">img is image "image"; </span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">src is source "resource"; </span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">a is anchor "anchor"; </span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">href is hypertext reference "hypertext address" </span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">Question 4 examines the principles of HTTP</span></p><p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span></p><p>Answer: B. <img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/e3fe2b8b2b3caf68d46305ba97da9901-4.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"/></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">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. </span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">A, wrong, there is no so-called VIP channel. </span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">B, correct</span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">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. </span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">D, error. Each visit is a different addressing process, and the path will not be "recorded". </span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;"></span></p><p><span style="font-size:14px;line-height:125%;font-family:'Times New Roman', serif;color:#FF0000;"><br/>Question 5 Plain text</span></p><p style="text-indent:28px;"><img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/a73a4232f018d580aa0b68402e1afe9e-5.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"/></p><p style="text-indent:28px;">答案:C。</p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">用记事本打开,不是乱码,是可读的,那么一定是纯本文文件。只有文本,没有样式,没有语义。</span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">所以,.java文件是纯文本的,.class文件不是纯文本的。</span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">所有的纯文本文件都能用记事本、notepad++、editplus、sublime编辑。</span></p><p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">第6题 考察XHTML</span></p><p><img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/a73a4232f018d580aa0b68402e1afe9e-6.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"/></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">答案:B。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">所有的标签名、属性都要小写,必须使用引号,必须封闭。答案是B</span></p><p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">第7题 考察定义列表</span></p><p><img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/a73a4232f018d580aa0b68402e1afe9e-7.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"/></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">答案:B。</span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">一定要记住每个标签标示什么,就是英语原意是什么?比如</span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">dl 就是definition list, 定义列表;</span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">dt 就是definition title,定义标题;</span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">dd就是definition description,定义描述</span></p><p style="background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">第8题 考察相对路径</span></p><p><img style="max-width:90%" style="max-width:90%" src="https://img.php.cn/upload/article/000/000/194/a73a4232f018d580aa0b68402e1afe9e-8.png" alt="Sharing small exercises suitable for novices in html" title="1.PNG"/><br/></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">1.html中,有一个能够点击的图片。所以骨架:</span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">1 <a href=""><img src="" / alt="Sharing small exercises suitable for novices in html" ></a></pre><div class="contentsignin">Copy after login</div></div><p style="max-width:90%"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">href里面是相对路径,要从1.html出发找到2.html;</span></p><p style="text-indent:28px;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">src里面也是相对路径,要从1.html出发找到kaola.png。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">标准答案:</span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false">1 <a href="../myweb2/2.html" target="_blank"><img src="../../photo/kaola.png" / alt="Sharing small exercises suitable for novices in html" ></a></pre><div class="contentsignin">Copy after login</div></div><p><span style="max-width:90%">我们一直在用的是相对路径,就是从自己出发找到别人。用相对路径的好处很明显,就是站点文件夹可以拷着走。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">相对路径的好处:站点不管拷贝到哪里,文件和图片的相对路径关系都是不变的。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">相对路径使用有一个前提,就是网页文件和你的图片,必须在一个服务器上。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">比如,你现在想插入一个新浪网上的图片,那么就不能用相对路径。就要用绝对路径。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">绝对路径非常简单,所有以http://开头的路径,就是绝对路径。 </span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false"><img src="http://i1.sinaimg.cn/dy/deco/2013/0329/logo/LOGO_1x.png" alt="" /> <a href="http://www.sohu.com">点击我跳转到搜狐</a></pre><div class="contentsignin">Copy after login</div></div><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(204,255,255);">如果我的网页在</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(204,255,255);">C</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(204,255,255);">盘,图片却在</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(204,255,255);">D</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(204,255,255);">盘,能不能插入呢?</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;"> </span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">答案:用相对路径不能,用绝对路径也不能。</span></p><p style="background:#CCFFFF;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">注意,可以使用file://来插入,但是这种方法,没有任何意义!因为服务器上没有所谓c盘、d盘。</span></p><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;">下面的方法是行的,但是没有任何工程上的意义,这是因为服务器没有盘符,linux系统没有盘符,</span></p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:html;toolbar:false"><img src="file://C:\Users\Danny\Pictures\ 明星 \1.jpg" alt="" /></pre><div class="contentsignin">Copy after login</div></div><p><span style="font-family:'楷体', '楷体_GB2312', SimKai;background-color:rgb(255,153,204);">总结一下:</span><span style="font-family:'楷体', '楷体_GB2312', SimKai;"> </span></p> <p style="text-indent:28px;background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">我们现在无论是在a标签、img标签,如果要用路径。只有两种路径能用,就是相对路径和绝对路径。</span></p> <p style="text-indent:28px;background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">相对路径,就是../   image/ 这种路径。从自己出发,找到别人;</span></p> <p style="text-indent:28px;background:#FF99CC;"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">绝对路径,就是http://开头的路径。</span></p> <p style="text-indent: 28px; background: rgb(255, 153, 204);"><span style="font-family:'楷体', '楷体_GB2312', SimKai;">绝对不允许使用file://开头的东西,这个是完全错误的!!</span></p>

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template