HTML MCQ Quiz - Objective Question with Answer for HTML - Download Free PDF

Last updated on Apr 3, 2024

Latest HTML MCQ Objective Questions

HTML Question 1:

_______ specifies the HTML Element that you want to style. 

  1. Attribute
  2. Selector
  3. Property
  4. Keyname

Answer (Detailed Solution Below)

Option 2 : Selector

HTML Question 1 Detailed Solution

The correct answer is Selector.

Key Points

  • The Selector in CSS specifies the HTML element that you want to style.
  • It identifies which element or elements on a web page should be affected by the defined set of rules in the style block or the external stylesheet. 

Additional Information

  • Attributes: In HTML, attributes provide additional information about an element, such as id, class, or style, defining characteristics or settings of the element directly in the markup. 
  • Property: In JavaScript, a property is a characteristic of an object, often described as a key-value pair, where the property name (key) is associated with a value that can be a primitive value, another object, or a function.
  • Key Name: In data structures and databases, a key name refers to the identifier used to access a value within a key-value pair, serving as a unique identifier to retrieve or manipulate the associated data.

HTML Question 2:

_______ attribute of the Form tag specifies how the form-data should be encoded when submitting it to the server. 

  1. bodytype
  2. datatype 
  3. enctype 
  4. formtype 

Answer (Detailed Solution Below)

Option 3 : enctype 

HTML Question 2 Detailed Solution

The correct answer is enctype.

Key Points

  • The enctype attribute in the HTML form tag specifies how the form data should be encoded when submitting it to the server.
  • It can be used only if the form's method is POST.
  • The possible values of this attribute include "application/x-www-form-urlencoded", "multipart/form-data", and "text/plain".
  • The default value of this attribute is "application/x-www-form-urlencoded".

Additional Information

bodytype, datatype, formtype:

  • These are not valid attributes of the form tag in HTML.
  • They don't exist in HTML specifications and therefore will not perform any function when included in an HTML form tag.

HTML Question 3:

Which tag creates a number / ordered list ?

      • All of the above

Answer (Detailed Solution Below)

Option 1 :

    HTML Question 3 Detailed Solution

    The correct answer is 

      Key Points

      In HTML, we use different tags to create different types of lists. Here's a brief explanation of the three tags you mentioned:

        1. : This stands for "Ordered List". As the name suggests, it's used for lists where order matters, like a step-by-step guide or ranking. The browser usually renders this as a list with numbers (1, 2, 3, etc.), hence it's also called a numbered list.
        2. Example:

          1.  
          2. First item

          3.  
          4. Second item

      Additional Information

        • : This stands for "Unordered List". It's used when you have a list of items where the order does not matter. The browser typically displays this as a bulleted list.
        • Example:

          •  
          • An item

          •  
          • Another item

        • : This stands for "Definition List". It's used to present a list of terms along with their definitions. The list is composed of
          tags to specify the terms and
          tags to give the definitions.
        • Example:

        •  
          HTML

           
          Hypertext Markup Language

           
          CSS

           
          Cascading Style Sheets

        • Within these list tags (
            ,
              ,
              ), we use the
            • tag to denote each list item. Except for the
              list, where we use
              and
              to denote the term and definition respectively.

    HTML Question 4:

    The tags used for specifying fonts in HTML are

    (A) < B >

    (B) < I >

    (C) < U >

    (D) < L >

    1. (A) and (B)
    2. (A) and (C) 
    3. (B) and (D) 
    4. (A), (B) and (C)

    Answer (Detailed Solution Below)

    Option 4 : (A), (B) and (C)

    HTML Question 4 Detailed Solution

    The correct answer is (A), (B) and (C)

    Key Points

    The tags mentioned in the question refer to formatting text in HTML:

    • (A) : This is the HTML tag used to make text bold.
    • (B) : This is the HTML tag used to make text italic.
    • (C) : This tag is used to underline text.
    • (D) : There is no standard HTML tag . It's not a valid tag in HTML.

    So, the correct answer is (A), (B) and (C) because is used for bold,  is used for italic and is used to underline, making text bold, italic and underline, respectively. Therefore, (A), (B) and (C) tags contribute to text formatting in HTML.

    HTML Question 5:

    Which of the following is NOT a pair tag in HTML?

    1. </li><li class="option">None of the above/More than one of the above</li></ol></div></div><div class="card answer-card"><h4 class="underline tag-h2">Answer <span class="text-light">(Detailed Solution Below)</span></h4> <div>Option 1 : <img></div> </div><div class="card solution-card"> <div class="card__header underline"> <h4>HTML Question 5 Detailed Solution</h4> </div> <div class="solution"> <p><img> tag</p> <p>It is used to embed an image on an HTML page. The <img> tag has two required attributes:</p> <p>src - Specifies the path to the image<br /> alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed<br /> Syntax</p> <p><img src="https://testbook.com/objective-questions/Image-path" alt="Image name " width=”" height=""></p> <p>Example</p> <p><img src="https://testbook.com/objective-questions/img.jpg" alt="Image-description" width="500" height="600"></p> <p><i> tag</p> <p>The content inside is typically displayed in italic.</p> <p><p> tag</p> <p>It defines a paragraph. Browsers automatically add a single blank line before and after each <p> element.</p> <p>Example:</p> <p><p>This is some text in a paragraph. </p></p> <p><title> tag</p> <p>It defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab. It cannot have more than one <title> element in an HTML document.</p> <div class="buttons-container"></div> </div> </div><div class="signup-banner"> <div class="sub-heading"> India’s <strong>#1 Learning</strong> Platform </div> <div class="main-heading"> Start Complete Exam Preparation </div><div class="features-container"> <div class="feature"> <div class="feature-icon"><img src="https://cdn.testbook.com/qb_resources/daily-live-master-classes.svg" alt="Live Masterclass" width="25" height="25"></div> <div class="feature-detail">Daily Live MasterClasses</div> </div> <div class="feature"> <div class="feature-icon"><img src="https://cdn.testbook.com/qb_resources/practice-question-bank.svg" alt="Practice Question Bank" width="25" height="25"></div> <div class="feature-detail">Practice Question Bank</div> </div> <div class="feature"> <div class="feature-icon"><img src="https://cdn.testbook.com/qb_resources/mock-tests-quizzes.svg" alt="Mock Tests & Quizzes" width="25" height="25"></div> <div class="feature-detail">Mock Tests & Quizzes</div> </div> </div><div class="buttons-container pure-u-1 pure-u-md-4-5 pure-u-lg-3-5"> <a target="_blank" class="pure-button pure-button-success" href="https://testbook.com/login?tile=signup&headerText=Sign%20Up%20To%20Get%20Free%20Solution%20PDF&utm_source=QuestionBank&utm_medium=QuestionBankRecommendation&referrer=QnA&referrerType=QnA">Get Started for Free</a> <a target="_blank" class=" download-app-btn" href="https://link.testbook.com/XVertTSUigb"> <svg id="livetype" xmlns="http://www.w3.org/2000/svg" width="119.66407" height="40" viewBox="0 0 119.66407 40"> <title>Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917
    Trusted by 5.6 Crore+ Students

    Top HTML MCQ Objective Questions

    Which among the following is not an HTML tag?