0% found this document useful (0 votes)
107 views16 pages

HTML Basics: Tags and Functions Explained

The document consists of a series of questions and answers related to HTML, covering topics such as HTML structure, tags, attributes, and form elements. Each question is multiple choice, with the correct answer provided immediately after. The content serves as a basic quiz or study guide for understanding HTML fundamentals.

Uploaded by

vivekdutt3105200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views16 pages

HTML Basics: Tags and Functions Explained

The document consists of a series of questions and answers related to HTML, covering topics such as HTML structure, tags, attributes, and form elements. Each question is multiple choice, with the correct answer provided immediately after. The content serves as a basic quiz or study guide for understanding HTML fundamentals.

Uploaded by

vivekdutt3105200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. What does HTML stand for?

a) Hyper Text Markup Language


b) High Text Markup Language
c) Hyperlink Markup Language
d) High Transfer Markup Language

Answer: a) Hyper Text Markup Language

2. What is the function of an HTML document?

a) It is used to define the structure and content of a webpage


b) It is a file type that stores images and videos
c) It is used to format text in Microsoft Word
d) It is used to compile code

Answer: a) It is used to define the structure and content of a webpage

3. What is the correct basic structure of an HTML document?

a) <html> <body> <head> <title> </title> </head> </body> </html>


b) <html> <head> <title> </title> </body> <html>
c) <title> <html> <head> <body> </body> </head> </html>
d) <html> <title> <body> <head> </title> </body> </head>

Answer: a) <html> <body> <head> <title> </title> </head> </body> </html>

4. What are HTML mark-up tags used for?

a) To edit images
b) To define and structure elements in an HTML document
c) To style documents
d) To perform database queries

Answer: b) To define and structure elements in an HTML document

5. Which HTML tag is used for defining headings in a webpage?

a) <head>
b) <h1> to <h6>
c) <header>
d) <title>

Answer: b) <h1> to <h6>

6. Which HTML tag is used to create paragraphs?


a) <div>
b) <p>
c) <section>
d) <span>

Answer: b) <p>

7. What is the purpose of the <br> tag in HTML?

a) It is used for bold text


b) It is used to insert a line break
c) It is used to break the text into two parts
d) It is used for adding a border

Answer: b) It is used to insert a line break

8. What is the difference between an opening and a closing HTML tag?

a) The opening tag has a slash /, and the closing tag does not
b) The closing tag has a slash /, and the opening tag does not
c) Both are the same
d) There is no closing tag in HTML

Answer: b) The closing tag has a slash /, and the opening tag does not

9. How do you create an ordered list in HTML?

a) <ul>
b) <ol>
c) <list>
d) <li>

Answer: b) <ol>

10. How do you create an unordered list in HTML?

a) <ol>
b) <ul>
c) <list>
d) <li>

Answer: b) <ul>

11. Which tag is used to define table rows in HTML?

a) <table>
b) <tr>
c) <td>
d) <th>

Answer: b) <tr>

12. What is the purpose of HTML frames?

a) To create sections for separate files within one webpage


b) To display multimedia
c) To create forms for user input
d) To format paragraphs and headings

Answer: a) To create sections for separate files within one webpage

13. What tag is used to create a hyperlink in HTML?

a) <link>
b) <a>
c) <href>
d) <anchor>

Answer: b) <a>

14. How do you insert an image in HTML?

a) <img src="[Link]">
b) <image source="[Link]">
c) <pic src="[Link]">
d) <insert img="[Link]">

Answer: a) <img src="[Link]">

15. Which of the following is a multimedia element that can be embedded in HTML?

a) Video
b) Audio
c) Both a and b
d) None of the above

Answer: c) Both a and b

16. Which HTML tag is used to create a form for user input?

a) <form>
b) <input>
c) <submit>
d) <text>
Answer: a) <form>

17. Which input type is used for creating a password field in an HTML form?

a) <input type="text">
b) <input type="password">
c) <input type="submit">
d) <input type="email">

Answer: b) <input type="password">

18. How do you create a text input field in an HTML form?

a) <form type="text">
b) <input type="text">
c) <field type="text">
d) <input type="input">

Answer: b) <input type="text">

19. Which attribute is used to specify the destination of a hyperlink?

a) src
b) href
c) link
d) target

Answer: b) href

20. What does the <table> tag define in HTML?

a) A list
b) A hyperlink
c) A table
d) A frame

Answer: c) A table

21. Which of the following is a block-level element in HTML?

a) <span>
b) <div>
c) <a>
d) <img>

Answer: b) <div>
22. What is the correct syntax for adding comments in HTML?

a) <!-- Comment -->


b) // Comment //
c) /* Comment */
d) <comment> Comment </comment>

Answer: a) <!-- Comment -->

23. What does the <title> tag in HTML do?

a) Displays the page title in the browser tab


b) Inserts a title on the webpage
c) Creates a hyperlink
d) Adds a heading to the page body

Answer: a) Displays the page title in the browser tab

24. How do you create a checkbox in an HTML form?

a) <input type="text">
b) <input type="checkbox">
c) <input type="radio">
d) <input type="button">

Answer: b) <input type="checkbox">

25. Which tag is used to define an item in a list?

a) <ul>
b) <ol>
c) <li>
d) <item>

Answer: c) <li>

26. Which attribute is used to open a hyperlink in a new tab or window?

a) src
b) href
c) target="_blank"
d) link

Answer: c) target="_blank"
27. What is the correct HTML for creating a text area in a form?

a) <textarea rows="4" cols="50"></textarea>


b) <input type="textarea">
c) <form type="textarea">
d) <textbox rows="4" cols="50"></textbox>

Answer: a) <textarea rows="4" cols="50"></textarea>

28. Which of the following is a valid HTML tag for adding a video?

a) <media>
b) <video>
c) <movie>
d) <source>

Answer: b) <video>

29. Which of these is the correct HTML for inserting an audio file?

a) <audio src="song.mp3" controls></audio>


b) <sound src="song.mp3" controls></sound>
c) <play src="song.mp3" controls></play>
d) <audiofile src="song.mp3" controls></audiofile>

Answer: a) <audio src="song.mp3" controls></audio>

30. What is the purpose of the <label> tag in HTML forms?

a) It defines a title for a form


b) It links a form field to a text description
c) It defines an input field
d) It creates a submit button

Answer: b) It links a form field to a text description

31. Which of the following is a self-closing tag in HTML?

a) <div>
b) <p>
c) <img>
d) <h1>

Answer: c) <img>

32. What is the default alignment of text inside a <p> (paragraph) tag?
a) Left-aligned
b) Right-aligned
c) Center-aligned
d) Justified

Answer: a) Left-aligned

33. Which tag is used to add a horizontal line across the webpage?

a) <line>
b) <hr>
c) <br>
d) <hl>

Answer: b) <hr>

34. Which HTML attribute specifies an alternate text for an image, if the image cannot be
displayed?

a) alt
b) src
c) title
d) href

Answer: a) alt

35. Which HTML tag is used to display preformatted text?

a) <pre>
b) <code>
c) <blockquote>
d) <textarea>

Answer: a) <pre>

36. Which tag is used to create a drop-down list in an HTML form?

a) <select>
b) <dropdown>
c) <list>
d) <option>

Answer: a) <select>

37. Which of the following tags is used to embed an external webpage into an HTML document?
a) <iframe>
b) <frame>
c) <embed>
d) <object>

Answer: a) <iframe>

38. What is the purpose of the <th> tag in an HTML table?

a) To define a table row


b) To define a table column
c) To define a header cell in a table
d) To define a table data cell

Answer: c) To define a header cell in a table

39. What is the purpose of the method attribute in the <form> tag?

a) It specifies how form data should be sent to the server


b) It defines the style of the form
c) It controls the form's appearance
d) It links the form to an external style sheet

Answer: a) It specifies how form data should be sent to the server

40. What is the correct HTML element for defining emphasized text?

a) <em>
b) <i>
c) <strong>
d) <b>

Answer: a) <em>

41. What does the colspan attribute do in an HTML table?

a) Merges multiple rows


b) Merges multiple columns
c) Defines the width of a column
d) Sets the height of a row

Answer: b) Merges multiple columns

42. Which of the following is the correct way to create a radio button in an HTML form?

a) <input type="checkbox">
b) <input type="radio">
c) <input type="button">
d) <input type="select">

Answer: b) <input type="radio">

43. What does the <strong> tag do in HTML?

a) It creates a strong emphasis on the text


b) It makes text bold
c) It highlights the text
d) It creates a hyperlink

Answer: a) It creates a strong emphasis on the text

44. How do you create a link that opens in the same tab?

a) <a href="url" target="_self">


b) <a href="url" target="_blank">
c) <a href="url" target="_new">
d) <a href="url" target="tab">

Answer: a) <a href="url" target="_self">

45. Which HTML attribute specifies the URL of the page that the link goes to?

a) href
b) src
c) link
d) url

Answer: a) href

46. Which of the following is not a valid HTML5 form input type?

a) date
b) color
c) file
d) money

Answer: d) money

47. Which of the following HTML elements is used to define navigation links?

a) <footer>
b) <nav>
c) <header>
d) <main>
Answer: b) <nav>

48. What is the default value of the type attribute in an <input> tag?

a) text
b) submit
c) button
d) password

Answer: a) text

49. How do you create a tooltip that appears when a user hovers over an element in HTML?

a) Using the title attribute


b) Using the tooltip attribute
c) Using the hover attribute
d) Using JavaScript only

Answer: a) Using the title attribute

50. Which HTML element is used for defining a footer for a document or section?

a) <footer>
b) <bottom>
c) <section>
d) <aside>

Answer: a) <footer>

51. What is the correct HTML for creating a horizontal rule?

a) <hr />
b) <line>
c) <hline>
d) <horizontal>

Answer: a) <hr />

52. Which of the following HTML elements is used to include a JavaScript file?

a) <js>
b) <script>
c) <javascript>
d) <link>

Answer: b) <script>
53. How can you create a numbered list in HTML?

a) Using <ol> for ordered list and <li> for list items
b) Using <ul> for unordered list and <li> for list items
c) Using <list> for both
d) Using <item> for list items only

Answer: a) Using <ol> for ordered list and <li> for list items

54. Which tag is used to define a division or a section in an HTML document?

a) <section>
b) <div>
c) <area>
d) <group>

Answer: b) <div>

55. How do you make a numbered list start with a specific number?

a) start="5" in the <ol> tag


b) begin="5" in the <ol> tag
c) number="5" in the <ol> tag
d) counter="5" in the <ol> tag

Answer: a) start="5" in the <ol> tag

56. Which attribute is used to specify that an input field must be filled out before submitting the
form?

a) required
b) mandatory
c) validate
d) form

Answer: a) required

57. Which HTML tag is used to define a container for metadata (data about data) in a document?

a) <meta>
b) <head>
c) <data>
d) <info>

Answer: a) <meta>
58. What does the target attribute in an <a> tag specify?

a) The type of link


b) The destination of the link
c) Where to open the linked document
d) The security level of the link

Answer: c) Where to open the linked document

59. Which of the following is a semantic HTML element?

a) <div>
b) <span>
c) <article>
d) <header>

Answer: c) <article>

60. What is the correct HTML for creating an email input field?

a) <input type="mail">
b) <input type="email">
c) <input type="textbox">
d) <input type="text">

Answer: b) <input type="email">

61. Which of the following tags is used to define an abbreviation in HTML?

a) <abbr>
b) <abbrv>
c) <short>
d) <acronym>

Answer: a) <abbr>

62. Which attribute of the <img> tag is used to provide alternative text for an image?

a) title
b) src
c) alt
d) caption

Answer: c) alt

63. What does the <cite> tag represent in HTML?


a) The title of a work
b) A citation for a reference
c) A citation for a quote
d) All of the above

Answer: d) All of the above

64. Which HTML tag is used to display a horizontal rule (line) in a document?

a) <line>
b) <hr>
c) <hline>
d) <rule>

Answer: b) <hr>

65. What is the use of the <aside> element in HTML?

a) To define the main content of the document


b) To define side content related to the main content
c) To create a navigation menu
d) To display images

Answer: b) To define side content related to the main content

66. How do you specify a placeholder text in an input field in HTML?

a) Using the placeholder attribute


b) Using the text attribute
c) Using the hint attribute
d) Using the default attribute

Answer: a) Using the placeholder attribute

67. Which HTML element is used to define a section that is quoted from another source?

a) <quote>
b) <blockquote>
c) <cite>
d) <reference>

Answer: b) <blockquote>

68. Which of the following is the correct syntax for creating a button in HTML?

a) <button>
b) <btn>
c) <input type="button">
d) Both a and c

Answer: d) Both a and c

69. How can you change the color of text in HTML?

a) Using the color attribute in the <p> tag


b) Using CSS styles
c) Using the bgcolor attribute
d) Using the style attribute in the <p> tag

Answer: b) Using CSS styles

70. Which tag is used to define a navigation link section in HTML5?

a) <nav>
b) <links>
c) <menu>
d) <header>

Answer: a) <nav>

71. What does the <figure> tag represent in HTML?

a) An illustration or diagram
b) A mathematical figure
c) A numerical representation
d) A block of text

Answer: a) An illustration or diagram

72. What does the rows attribute specify in a <textarea> element?

a) The total number of rows in the form


b) The number of visible text lines
c) The maximum number of characters
d) The minimum number of characters

Answer: b) The number of visible text lines

73. How do you create a link to an external CSS stylesheet?

a) <link rel="stylesheet" href="[Link]">


b) <style src="[Link]">
c) <css href="[Link]">
d) <stylesheet href="[Link]">
Answer: a) <link rel="stylesheet" href="[Link]">

74. Which HTML tag is used for defining a self-contained piece of content that is related to the
document?

a) <div>
b) <section>
c) <span>
d) <article>

Answer: d) <article>

75. How do you specify the character set for an HTML document?

a) <meta charset="UTF-8">
b) <charset="UTF-8">
c) <meta encoding="UTF-8">
d) <meta char="UTF-8">

Answer: a) <meta charset="UTF-8">

76. Which element is used to define an inline frame in HTML?

a) <frame>
b) <iframe>
c) <inline>
d) <object>

Answer: b) <iframe>

77. Which HTML element is used to define a list item in a list?

a) <item>
b) <li>
c) <list>
d) <ol>

Answer: b) <li>

78. Which tag is used to define a caption for a table in HTML?

a) <caption>
b) <header>
c) <title>
d) <thead>

Answer: a) <caption>
79. Which of the following is the correct way to add a comment in HTML?

a) <!-- This is a comment -->


b) // This is a comment
c) /* This is a comment */
d) <comment>This is a comment</comment>

Answer: a) <!-- This is a comment -->

80. What does the <code> tag represent in HTML?

a) A programming code
b) A legal code
c) A coding convention
d) A section of code

Answer: a) A programming code

You might also like