Site icon T4Tutorials.com

HTML MCQs

1. What does HTML stand for?

(A) Hyper Text Markup Language


(B) Hyper Trainer Marking Language


(C) High Text Machine Learning


(D) Hyper Tool Markup Line



2. Which of the following best describes HTML?

(A) A programming language


(B) A markup language


(C) A database language


(D) A scripting framework



3. Which part of an HTML document contains information not displayed on the webpage?

(A) Body section


(B) Footer section


(C) Head section


(D) Main section



4. HTML was primarily created to structure which type of content?

(A) Mobile applications


(B) Desktop software


(C) Web pages


(D) Operating systems



5. Who is credited with inventing HTML?

(A) Dennis Ritchie


(B) Tim Berners-Lee


(C) James Gosling


(D) Brendan Eich



6. Which tag is used to define the structure of an HTML document?

” onclick=”checkAnswer(‘q6′,’‘)” /> (A) <html>


” onclick=”checkAnswer(‘q6′,’‘)” /> (B) <head>


” onclick=”checkAnswer(‘q6′,’‘)” /> (C) <body>


” onclick=”checkAnswer(‘q6′,’‘)” /> (D) <title>



7. Which of the following is a correct HTML syntax for a paragraph?

This is a paragraph

” onclick=”checkAnswer(‘q7′,’

This is a paragraph

‘)” /> (A) <p>This is a paragraph</p>


This is a paragraph” onclick=”checkAnswer(‘q7′,’

This is a paragraph

‘)” /> (B) <para>This is a paragraph</para>


This is a paragraph” onclick=”checkAnswer(‘q7′,’

This is a paragraph

‘)” /> (C) <paragraph>This is a paragraph</paragraph>


This is a paragraph” onclick=”checkAnswer(‘q7′,’

This is a paragraph

‘)” /> (D) <pg>This is a paragraph</pg>



8. Which tag is used to insert a line break in HTML?

” onclick=”checkAnswer(‘q8′,’
‘)” /> (A) <break>


” onclick=”checkAnswer(‘q8′,’
‘)” /> (B) <lb>


” onclick=”checkAnswer(‘q8′,’
‘)” /> (C) <br>


” onclick=”checkAnswer(‘q8′,’
‘)” /> (D) <line>



9. How do you add a comment in HTML?

” onclick=”checkAnswer(‘q9′,’‘)” /> (A) <!– This is a comment –>


‘)” /> (B) // This is a comment


‘)” /> (C) /* This is a comment */


‘)” /> (D) # This is a comment



10. Which HTML element is inline by default?

” onclick=”checkAnswer(‘q10′,’‘)” /> (A) <div>


” onclick=”checkAnswer(‘q10′,’‘)” /> (B) <span>


” onclick=”checkAnswer(‘q10′,’‘)” /> (C) <section>


” onclick=”checkAnswer(‘q10′,’‘)” /> (D) <article>



11. Which tag is used for the largest heading?

” onclick=”checkAnswer(‘q11′,’

‘)” /> (A) <h1>

” onclick=”checkAnswer(‘q11′,’

‘)” /> (B) <h2>

” onclick=”checkAnswer(‘q11′,’

‘)” /> (C) <h3>

” onclick=”checkAnswer(‘q11′,’

‘)” /> (D) <h4>

12. Which tag is used to create a paragraph in HTML?

” onclick=”checkAnswer(‘q12′,’

‘)” /> (A) <p>


” onclick=”checkAnswer(‘q12′,’

‘)” /> (B) <para>


” onclick=”checkAnswer(‘q12′,’

‘)” /> (C) <paragraph>


” onclick=”checkAnswer(‘q12′,’

‘)” /> (D) <pg>



13. Which tag makes text bold in HTML?

” onclick=”checkAnswer(‘q13′,’Both (A) and (B)’)” /> (A) <b>


” onclick=”checkAnswer(‘q13′,’Both (A) and (B)’)” /> (B) <strong>


(C) Both (A) and (B)


” onclick=”checkAnswer(‘q13′,’Both (A) and (B)’)” /> (D) <bold>



14. Which tag is used to quote content in HTML?

” onclick=”checkAnswer(‘q14′,’Both (A) and (B)’)” /> (A) <q>


” onclick=”checkAnswer(‘q14′,’Both (A) and (B)’)” /> (B) <blockquote>


(C) Both (A) and (B)


” onclick=”checkAnswer(‘q14′,’Both (A) and (B)’)” /> (D) <quote>



15. Which tag is used for preformatted text?

” onclick=”checkAnswer(‘q15′,’

')" /> (A) <pre>

" onclick="checkAnswer('q15','

')" /> (B) <code>

" onclick="checkAnswer('q15','

')" /> (C) <plaintext>

" onclick="checkAnswer('q15','

')" /> (D) <text>

16. Which tag is used to create a hyperlink in HTML?

" onclick="checkAnswer('q16','')" /> (A) <link>


" onclick="checkAnswer('q16','')" /> (B) <a>


" onclick="checkAnswer('q16','')" /> (C) <href>


" onclick="checkAnswer('q16','')" /> (D) <url>



17. How do you create an internal link to a section within the same page?

Go to Section 1" onclick="checkAnswer('q17','Go to Section 1')" /> (A) <a href="#section1">Go to Section 1</a>


Go to Section 1" onclick="checkAnswer('q17','Go to Section 1')" /> (B) <a link="section1">Go to Section 1</a>


Go to Section 1" onclick="checkAnswer('q17','Go to Section 1')" /> (C) <link href="section1">Go to Section 1</link>


Go to Section 1" onclick="checkAnswer('q17','Go to Section 1')" /> (D) <a id="section1">Go to Section 1</a>



18. Which attribute is used to create a link to send an email?

(A) href="mailto:example@mail.com"


(B) link="mailto:example@mail.com"


(C) src="email@example.com"


(D) href="email:example@mail.com"



19. Which HTML tag is used to create a clickable image link?

" onclick="checkAnswer('q19','')" /> (A) <img href="link.jpg">


" onclick="checkAnswer('q19','')" /> (B) <a src="link.jpg"><img></a>


" onclick="checkAnswer('q19','')" /> (C) <a href="link.html"><img src="image.jpg"></a>


" onclick="checkAnswer('q19','')" /> (D) <image link="link.html">



20. Which tag is typically used to create a navigation menu?

" onclick="checkAnswer('q20','All of the above')" /> (A) <nav>


" onclick="checkAnswer('q20','All of the above')" /> (B) <menu>


" onclick="checkAnswer('q20','All of the above')" /> (C) <ul>


(D) All of the above



21. Which tag is used to embed an image in HTML?

" onclick="checkAnswer('q21','')" /> (A) <image>


" onclick="checkAnswer('q21','')" /> (B) <img>


" onclick="checkAnswer('q21','')" /> (C) <src>


" onclick="checkAnswer('q21','')" /> (D) <picture>



22. Which attribute specifies the alternative text for an image?

(A) alt


(B) title


(C) src


(D) description



23. Which tag is used to embed an audio file in HTML5?

" onclick="checkAnswer('q23','


" onclick="checkAnswer('q23','


" onclick="checkAnswer('q23','


" onclick="checkAnswer('q23','



24. Which tag is used to embed a video file in HTML5?

" onclick="checkAnswer('q24','


" onclick="checkAnswer('q24','


" onclick="checkAnswer('q24','


" onclick="checkAnswer('q24','



25. Which HTML5 element is used to draw graphics on the web?

" onclick="checkAnswer('q25','


" onclick="checkAnswer('q25','


" onclick="checkAnswer('q25','


" onclick="checkAnswer('q25','



26. Which elements are used to associate a caption with an image?

and

" onclick="checkAnswer('q26','

and
')" /> (A) <figure> and <figcaption>

and

" onclick="checkAnswer('q26','
and
')" /> (B) <img> and <caption>

and

" onclick="checkAnswer('q26',' <figure> and<figcaption>')" /> (C) <image> and <title><br><p data-amp-original-style="display:inline-block; margin:2px 0;" class="amp-wp-c593299">and </p> <caption>" onclick="checkAnswer('q26',' <figure> and<figcaption>')" /> (D) <figure> and <caption><br><hr data-amp-original-style="margin:10px 0;" class="amp-wp-7e841fc"></figcaption></figure></caption></figcaption></figure>

27. Which tag is used for creating an ordered (numbered) list?

" onclick="checkAnswer('q27','

    ')" /> (A) <ul>

    " onclick="checkAnswer('q27','

      ')" /> (B) <ol>

      " onclick="checkAnswer('q27','

        ')" /> (C) <li>

        " onclick="checkAnswer('q27','

          ')" /> (D) <list>

28. Which tag is used for creating an unordered (bulleted) list?

" onclick="checkAnswer('q28','

    ')" /> (A) <ol>

    " onclick="checkAnswer('q28','

      ')" /> (B) <ul>

      " onclick="checkAnswer('q28','

        ')" /> (C) <li>

        " onclick="checkAnswer('q28','

          ')" /> (D) <list>

29. Which tags are used to create a definition list in HTML?

,

,
" onclick="checkAnswer('q29','
,
,
')" /> (A) <dl>, <dt>, <dd>

, " onclick="checkAnswer('q29','

,
,
')" /> (B) <list>, <item>

,

  • " onclick="checkAnswer('q29','
    ,
    ,
    ')" /> (C) <ul>, <li>

    ,

  • " onclick="checkAnswer('q29','
    ,
    ,
    ')" /> (D) <ol>, <li>

  • 30. Which tag is used to create a table in HTML?

    " onclick="checkAnswer('q30','

    ')" /> (A) <thead>

    " onclick="checkAnswer('q30','

    ')" /> (B) <table>

    " onclick="checkAnswer('q30','

    ')" /> (C) <tbody>

    " onclick="checkAnswer('q30','

    ')" /> (D) <tr>

    31. Which attribute specifies the number of rows a cell should span in a table?

    (A) colspan


    (B) span


    (C) rowspan


    (D) height



    32. Which tag is used to create a form in HTML?

    " onclick="checkAnswer('q32','

    ')" /> (A) <input>

    " onclick="checkAnswer('q32','

    ')" /> (B) <form>

    " onclick="checkAnswer('q32','

    ')" /> (C) <textarea>

    " onclick="checkAnswer('q32','

    ')" /> (D) <button>

    33. Which input type allows the user to select a date?

    (A) text


    (B) date


    (C) datetime


    (D) calendar



    34. Which attribute specifies where a form’s data should be sent?

    (A) method


    (B) action


    (C) target


    (D) type



    35. Which tags are used to create a dropdown list in HTML?

    and


    and


    and


    and " onclick="checkAnswer('q35','



    36. Which tag is used to create a clickable button in HTML?

    " onclick="checkAnswer('q36','Both A and B')" /> (A) <input type="button">


    " onclick="checkAnswer('q36','Both A and B')" /> (B) <button>


    (C) Both A and B


    " onclick="checkAnswer('q36','Both A and B')" /> (D) <click>



    37. Which HTML5 attribute checks the input field for valid data before submitting a form?

    (A) validate


    (B) required


    (C) pattern


    (D) autofocus



    38. Which elements are considered semantic in HTML5?

    and " onclick="checkAnswer('q38','

    ,
    ,
    ,
    ')" /> (A) <div> and <span>

    ,

    ,
    ,
    " onclick="checkAnswer('q38','
    ,
    ,
    ,
    ')" /> (B) <header>, <footer>, <article>, <section>

    and " onclick="checkAnswer('q38','

    ,
    ,
    ,
    ')" /> (C) <b> and <i>

    and

    " onclick="checkAnswer('q38','
    ,
    ,
    ,
    ')" /> (D) <table> and <tr>

    39. Which tags represent main content divisions in HTML5?

    ,

    ,

    40. Which HTML5 element is specifically used for site navigation?

    " onclick="checkAnswer('q40','

    41. Which tag is used to create a generic container in HTML?

    " onclick="checkAnswer('q41','

    ')" /> (A) <container>

    " onclick="checkAnswer('q41','

    ')" /> (B) <div>

    " onclick="checkAnswer('q41','

    ')" /> (C) <span>

    " onclick="checkAnswer('q41','

    ')" /> (D) <section>

    42. Which tag is used for inline grouping of text without introducing a line break?

    " onclick="checkAnswer('q42','')" /> (A) <div>


    " onclick="checkAnswer('q42','')" /> (B) <span>


    " onclick="checkAnswer('q42','')" /> (C) <p>


    " onclick="checkAnswer('q42','')" /> (D) <article>



    43. Which of the following is a block-level element?

    " onclick="checkAnswer('q43','

    ')" /> (A) <span>

    " onclick="checkAnswer('q43','

    ')" /> (B) <div>

    " onclick="checkAnswer('q43','

    ')" /> (C) <a>

    " onclick="checkAnswer('q43','

    ')" /> (D) <strong>

    44. Which section contains metadata and links to scripts or stylesheets in HTML?

    " onclick="checkAnswer('q44','

    ')" /> (A) <header>

    " onclick="checkAnswer('q44','

    ')" /> (B) <head>

    " onclick="checkAnswer('q44','

    ')" /> (C) <body>

    " onclick="checkAnswer('q44','

    ')" /> (D) <footer>

    45. Which tag is used to link a favicon for a website?

    " onclick="checkAnswer('q45','')" /> (A) <icon>


    " onclick="checkAnswer('q45','')" /> (B) <link rel="icon">


    " onclick="checkAnswer('q45','')" /> (C) <favicon>


    " onclick="checkAnswer('q45','')" /> (D) <meta>



    46. How do you link an external CSS file in HTML?

    " onclick="checkAnswer('q46','')" /> (A) <link rel="stylesheet" href="style.css">


    " title="')" /> (A) <script src="script.js"></script>


    " onclick="checkAnswer('q47','<script></img>')" /> (B) <link rel="script" href="script.js">


    " onclick="checkAnswer('q47','<script></img>')" /> (C) <js src="script.js">


    " title="