HTML Fundamentals

Description: Test your knowledge on the basics of HTML, the foundation of web development.
Number of Questions: 15
Created by:
Tags: html web development front-end
Attempted 0/15 Correct 0 Score 0

What does HTML stand for?

  1. Hypertext Markup Language

  2. Hypertext Modeling Language

  3. Hypertext Machine Language

  4. Hypertext Markup Link


Correct Option: A
Explanation:

HTML stands for Hypertext Markup Language, a markup language used to create the structure and content of web pages.

Which HTML element is used to define the main content of a web page?

  1. <head>

  2. <body>

  3. <title>

  4. <html>


Correct Option: B
Explanation:

The <body> element in HTML defines the main content of a web page, where the actual content is placed.

What is the correct syntax for creating a heading in HTML?

  1. <h1>Heading</h1>

  2. <heading>Heading</heading>

  3. <h>Heading</h>

  4. <head>Heading</head>


Correct Option: A
Explanation:

In HTML, headings are created using the <h1> to <h6> elements, with <h1> being the most prominent heading.

Which HTML attribute is used to specify the link destination of an anchor (<a>) element?

  1. href

  2. src

  3. alt

  4. title


Correct Option: A
Explanation:

The 'href' attribute in the <a> element specifies the link destination, allowing users to navigate to another web page or section of the current page.

What is the purpose of the <meta> tag in HTML?

  1. To define the title of the web page

  2. To provide metadata about the web page

  3. To create a link to another web page

  4. To insert an image into the web page


Correct Option: B
Explanation:

The <meta> tag in HTML is used to provide metadata about the web page, such as its title, description, keywords, and other information relevant to search engines and web crawlers.

Which HTML element is used to create a bulleted list?

  1. <ul>

  2. <ol>

  3. <li>

  4. <dl>


Correct Option: A
Explanation:

The <ul> element in HTML is used to create an unordered (bulleted) list, where each item is represented by a list item (<li>).

What is the correct syntax for creating a table in HTML?

  1. <table><thead><tr><th>Heading</th></tr></thead><tbody><tr><td>Data</td></tr></tbody></table>

  2. <table><tr><th>Heading</th></tr><tr><td>Data</td></tr></table>

  3. <table><thead><tr><td>Heading</td></tr></thead><tbody><tr><th>Data</th></tr></tbody></table>

  4. <table><tr><td>Heading</td></tr><tr><td>Data</td></tr></table>


Correct Option: A
Explanation:

In HTML, a table is created using the <table> element, with <thead> for the table header, <tbody> for the table body, <tr> for table rows, and <th> and <td> for table headings and data cells respectively.

Which HTML element is used to create a form?

  1. <form>

  2. <input>

  3. <button>

  4. <label>


Correct Option: A
Explanation:

The <form> element in HTML is used to create a form that allows users to input data, such as text, numbers, or selections, and submit it to a server for processing.

What is the purpose of the <style> tag in HTML?

  1. To define the structure of the web page

  2. To provide styling information for the web page

  3. To create a link to an external style sheet

  4. To insert an image into the web page


Correct Option: B
Explanation:

The <style> tag in HTML is used to define styling information for the web page, allowing you to control the appearance of elements such as fonts, colors, and layouts.

Which HTML attribute is used to specify the width of an image?

  1. width

  2. height

  3. src

  4. alt


Correct Option: A
Explanation:

The 'width' attribute in the <img> element specifies the width of the image in pixels or as a percentage of the parent container.

What is the purpose of the <script> tag in HTML?

  1. To define the structure of the web page

  2. To provide styling information for the web page

  3. To include JavaScript code into the web page

  4. To insert an image into the web page


Correct Option: C
Explanation:

The <script> tag in HTML is used to include JavaScript code into the web page, allowing you to add dynamic behavior and interactivity to the page.

Which HTML element is used to create a horizontal line?

  1. <hr>

  2. <br>

  3. <p>

  4. <div>


Correct Option: A
Explanation:

The <hr> element in HTML is used to create a horizontal line, typically used to separate different sections or content on a web page.

What is the correct syntax for creating a link to another web page in HTML?

  1. <a href="https://example.com"&gt;Link Text</a>

  2. <a src="https://example.com"&gt;Link Text</a>

  3. <a target="https://example.com"&gt;Link Text</a>

  4. <a title="https://example.com"&gt;Link Text</a>


Correct Option: A
Explanation:

In HTML, a link to another web page is created using the <a> element, with the 'href' attribute specifying the destination URL and the link text displayed to the user.

Which HTML element is used to create a paragraph?

  1. <p>

  2. <div>

  3. <span>

  4. <h1>


Correct Option: A
Explanation:

The <p> element in HTML is used to create a paragraph, which is a block of text that typically contains one or more sentences.

What is the purpose of the <title> tag in HTML?

  1. To define the structure of the web page

  2. To provide styling information for the web page

  3. To specify the title of the web page

  4. To insert an image into the web page


Correct Option: C
Explanation:

The <title> tag in HTML is used to specify the title of the web page, which is displayed in the browser's title bar and search engine results.

- Hide questions