原文: github.com/paddingme/F…css
這裏是 Front End Web Development QuizHTML 部分問題與解答html
Q: <keygen>
是正確的HTML5標籤嗎?html5
A: 是。git
<keygen>
標籤規定用於表單的密鑰對生成器字段。當提交表單時,私鑰存儲在本地,公鑰發送到服務器。是HTML5 標籤。github
Q: <bdo>
標籤是否能夠改變文本方向?web
A: 能夠。shell
<bdo>
標籤覆蓋默認的文本方向。bootstrap
<bdo dir="rtl">Here is some text</bdo>
複製代碼
Q: 下列HTML代碼是否正確?瀏覽器
<figure>
<img src="myimage.jpg" alt="My image">
<figcaption>
<p>This is my self portrait.</p>
</figcaption>
</figure>
複製代碼
A: 正確bash
<figure>
標籤規定獨立的流內容(圖像、圖表、照片、代碼等等)。figure
元素的內容應該與主內容相關,但若是被刪除,則不該對文檔流產生影響。使用<figcaption>
元素爲figure
添加標題(caption)。
Q: 哪一種狀況下應該使用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.
Q: 在一個結構良好的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.
Q: 若是你有一個搜索結果頁面,你想高亮搜索的關鍵詞。什麼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.
Q: 下列代碼中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 元素的父元素及其子元素。
HTML5 支持塊級超連接嗎?例如:
<article>
<a href="#">
<h1>Hello</h1>
<p>I am some text</p>
</a>
</article>
複製代碼
A: 支持。
HTML5中<a>
元素表現爲一個超連接,支持任何行內元素和塊級元素。
Q: 當下列的HTML代碼加載時會觸發新的HTTP請求嗎?
<img src="mypic.jpg" style="visibility: hidden" alt="My picture">
複製代碼
A: 會哇
Q: 當下列的HTML代碼加載時會觸發新的HTTP請求嗎?
<div style="display: none;">
<img src="mypic.jpg" alt="My photo">
</div>
複製代碼
A: 會!
main1.css
必定會在alert('Hello world')
被加載和編譯嗎?
<head>
<link href="main1.css" rel="stylesheet">
<script>
alert('Hello World');
</script>
</head>
複製代碼
A: 是!
Q: 在main2.css
獲取前main1
必定必須被下載解析嗎?
<head>
<link href="main1.css" rel="stylesheet">
<link href="main2.css" rel="stylesheet">
</head>
複製代碼
A: no!
Q: 在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!
瀏覽器如何渲染,能夠查閱以下文章:
HTML5 方便的資料可閱讀: