总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享html部分的笔试题(附答案),大家可以自己做做,看看能答对几个!
相关推荐:《web前端笔试题库之css篇》
q1:aa983b9eb8086376f1f6481364a02e5a 是正确的html5标签吗?
a:是。
aa983b9eb8086376f1f6481364a02e5a 标签规定用于表单的密钥对生成器字段。当提交表单时,私钥存储在本地,公钥发送到服务器。是html5 标签。
q2:71af07a0e88a1ac1ff73f855702ac153 标签是否可以改变文本方向?
a:可以。
71af07a0e88a1ac1ff73f855702ac153标签覆盖默认的文本方向。
<bdo dir="rtl">here is some text</bdo>
q3:下列html代码是否正确?
<figure> <img src="myimage.jpg" alt="my image"> <figcaption> <p>this is my self portrait.</p> </figcaption></figure>
a:正确
<figure> 标签规定独立的流内容(图像、图表、照片、代码等等)。figure 元素的内容应该与主内容相关,但如果被删除,则不应对文档流产生影响。使用<figcaption>元素为figure添加标题(caption)。
q4:哪种情况下应该使用small标签?当你想在h1 标题后创建副标题?还是当在footer里面增加版权信息?
a:small标签一般使用场景是在版权信息和法律文本里使用,也可以在标题里使用标注附加信息(bootstrap中可见),但不可以用来创建副标题。
the html small element (<small>) makes the text font size one size smaller (for example, from large to medium, or from small to x-small) down to the browser's minimum font size. in html5, this element is repurposed to represent side-comments and small print, including copyright and legal text, independent of its styled presentation.
q5:在一个结构良好的web网页里,多个h1标签会不利于seo吗?
a:不影响。
according to matt cutts (lead of google's webspam team and the de facto expert on these things), using multiple <h1> tags is fine, as long as you're not abusing it (like sticking your whole page in an <h1> and using css to style it back to normal size). that would likely have no effect, and might trigger a penalty, as it looks spammy.
if you have multiple headings and it would be natural to use multiple <h1>'s, then go for it.
摘自:http://www.quora.com/does-using-multiple-h1-tags-on-a-page-affect-search-engine-rankings
q6:如果你有一个搜索结果页面,你想高亮搜索的关键词。什么html 标签可以使用?
a:<mark> 标签表现高亮文本。
the html <mark> element represents highlighted text, i.e., a run of text marked for reference purpose, due to its relevance in a particular context. for example it can be used in a page showing search results to highlight every instance of the searched for word.
q7:下列代码中scope 属性是做什么的?
<article> <h1>hello world</h1> <style scoped> p { color: #ff0; } </style> <p>this is my text</p></article><article> <h1>this is awesome</h1> <p>i am some other text</p></article>
a:scoped 属性是一个布尔属性。如果使用该属性,则样式仅仅应用到 style 元素的父元素及其子元素。
q8:html5 支持块级超链接吗?例如:
<article> <a href="#"> <h1>hello</h1> <p>i am some text</p> </a></article>
a:支持。
html5中<a> 元素表现为一个超链接,支持任何行内元素和块级元素。
q9:当下列的html代码加载时会触发新的http请求吗?
<img src="mypic.jpg" style="visibility: hidden" alt="my picture">
a:会哇
q10:当下列的html代码加载时会触发新的http请求吗?
<div style="display: none;"> <img src="mypic.jpg" alt="my photo"></div>
a:会!
q11:main1.css一定会在alert('hello world')被加载和编译吗?
<head> <link href="main1.css" rel="stylesheet"> <script> alert('hello world'); </script></head>
a:是!
q12:在main2.css获取前main1一定必须被下载解析吗?
<head> <link href="main1.css" rel="stylesheet"> <link href="main2.css" rel="stylesheet"></head>
a:no!
q13:在paragraph 1加载后main2.css才会被加载编译吗?
<head> <link href="main1.css" rel="stylesheet"></head><body> <p>paragraph 1</p> <p>paragraph 2</p> <link href="main2.css" rel="stylesheet"></body>
a:yes!
【相关推荐:html视频教程、web前端】
以上就是web前端笔试题库之html篇的详细内容。