web前端筆試題庫之HTML篇

【web前端筆試題庫之HTML篇】總結了一些web前端面試(筆試)題分享給大家 , 本篇文章就先給大家分享HTML部分的筆試題 , 附答案 , 大家可以自己做做 , 看看能答對幾個!

web前端筆試題庫之HTML篇

文章插圖

Q1:<keygen> 是正確的HTML5標簽嗎?
A:是 。
<keygen> 標簽規定用于表單的密鑰對生成器字段 。 當提交表單時 , 私鑰存儲在本地 , 公鑰發送到服務器 。 是HTML5 標簽 。
Q2:<bdo> 標簽是否可以改變文本方向?
A:可以 。
<bdo>標簽覆蓋默認的文本方向 。
<bdo dir="rtl">Here is some text</bdo>Q3:下列HTML代碼是否正確?
<figure> <img src=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"myimage.jpg" alt="My image">

This is my self portrait.

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=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"#">

Hello

I am some text

A:支持 。
HTML5中<a> 元素表現為一個超鏈接 , 支持任何行內元素和塊級元素 。
Q9:當下列的HTML代碼加載時會觸發新的HTTP請求嗎?
<img src=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"mypic.jpg" style="visibility: hidden" alt="My picture">A:會哇
Q10:當下列的HTML代碼加載時會觸發新的HTTP請求嗎?
<div style="display: none;"> <img src=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"mypic.jpg" alt="My photo">
A:會!
Q11:main1.css一定會在alert('Hello world')被加載和編譯嗎?
<head> <link href=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"main1.css" rel="stylesheet"> A:是!
Q12:在main2.css獲取前main1一定必須被下載解析嗎?
<head> <link href=https://www.52zixue.com/zhanzhang/webqd/html/04/21/70518/"main1.css" rel="stylesheet">

推薦閱讀


上一篇:關于 CSS 變量的一些你可能不了解的事!

下一篇:小米路由器AX3000值得入手嗎?小米路由器AX3000體驗評測