前端面試題(HTML)

原文: github.com/paddingme/F…css

HTML 部分問題與解答

這裏是 Front End Web Development QuizHTML 部分問題與解答html

  1. Q: <keygen> 是正確的HTML5標籤嗎?html5

    A: 是。git

    <keygen> 標籤規定用於表單的密鑰對生成器字段。當提交表單時,私鑰存儲在本地,公鑰發送到服務器。是HTML5 標籤。github

  2. Q: <bdo> 標籤是否能夠改變文本方向?web

    A: 能夠。shell

    <bdo>標籤覆蓋默認的文本方向。bootstrap

    <bdo dir="rtl">Here is some text</bdo>
    複製代碼
  3. 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)。

  4. 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.

  5. 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.

    摘自:www.quora.com/Does-using-…

  6. 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.

  7. 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 元素的父元素及其子元素。

  8. HTML5 支持塊級超連接嗎?例如:

    <article>
        <a href="#">
            <h1>Hello</h1>
            <p>I am some text</p>
        </a>
    </article>
    複製代碼

    A: 支持。

    HTML5中<a> 元素表現爲一個超連接,支持任何行內元素和塊級元素。

  9. Q: 當下列的HTML代碼加載時會觸發新的HTTP請求嗎?

    <img src="mypic.jpg" style="visibility: hidden" alt="My picture">
    複製代碼

    A: 會哇

  10. Q: 當下列的HTML代碼加載時會觸發新的HTTP請求嗎?

    <div style="display: none;">
        <img src="mypic.jpg" alt="My photo">
    </div>
    複製代碼

    A: 會!

  11. main1.css必定會在alert('Hello world')被加載和編譯嗎?

    <head>
        <link href="main1.css" rel="stylesheet">
        <script>
            alert('Hello World');
        </script>
    </head>
    複製代碼

    A: 是!

  12. Q: 在main2.css獲取前main1必定必須被下載解析嗎?

    <head>
        <link href="main1.css" rel="stylesheet">
        <link href="main2.css" rel="stylesheet">
    </head>
    複製代碼

    A: no!

  13. 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!

知識點總結

相關文章
相關標籤/搜索