List of Questions

Questions Topic Wise
MCQ & Explanation
Topic:Basic Structure
-
1.What is the primary purpose of the <head> element in an HTML document?
2.Which HTML element contains the content visible to users in a web browser?
3.What is the purpose of the <html> element in an HTML document?
4.Which HTML element is used to define the content that appears in the browser's title bar or tab?
5.What role does the <body> element play in an HTML document?
6.In HTML, what is the purpose of the <!DOCTYPE> declaration?
7.What does the 'lang' attribute in the <html> tag indicate?
8.Which of the following is NOT a valid child element of the <head> tag in HTML?
9.What is the purpose of the <meta> tag with the 'viewport' attribute in HTML?
10.What is the purpose of the 'charset' attribute in the <meta> tag?
Topic:Tags and Elements
-
1.Which HTML element is used to create an ordered list?
2.What is the purpose of the <img> tag in HTML?
3.Which HTML element is used to define a hyperlink?
4.What is the purpose of the <p> tag in HTML?
5.Which HTML element is used to create an unordered list?
6.Which HTML element is used to define the main content of a webpage?
7.Which HTML element is used to create a table row?
8.What is the purpose of the <header> element in HTML?
9.Which HTML element is used to define a division or section in a webpage?
10.What does the 'alt' attribute in the <img> tag represent?
Topic:Attributes
-
1.What is the purpose of the 'href' attribute in the <a> tag?
2.What is the purpose of the 'src' attribute in the <img> tag?
3.What is the purpose of the 'alt' attribute in the <img> tag?
4.What is the purpose of the 'class' attribute in HTML?
5.What is the purpose of the 'id' attribute in HTML?
6.What is the purpose of the 'title' attribute in HTML?
7.What is the purpose of the 'hreflang' attribute in the <a> tag?
8.What is the purpose of the 'target' attribute in the <a> tag?
9.What is the purpose of the 'rel' attribute in the <a> tag?
10.What is the purpose of the 'style' attribute in HTML?
Topic:Forms
-
1.Which HTML element is used to create a form?
2.Which attribute is used to specify the URL where the form data will be submitted?
3.Which HTML element is used to create a text input field?
4.What is the purpose of the 'required' attribute in HTML form elements?
5.Which HTML element is used to create a dropdown menu?
6.Which attribute is used to specify the type of input field in HTML?
7.Which HTML element is used to create a radio button?
8.What is the purpose of the 'maxlength' attribute in HTML form elements?
9.Which HTML element is used to create a checkbox?
10.What is the purpose of the 'name' attribute in HTML form elements?
Topic:Semantic HTML
-
1.Which HTML element is used to define the main content of a webpage, excluding headers, footers, and navigation?
2.Which HTML element is used to define introductory content or navigation links at the top of a webpage?
3.Which HTML element is used to define a standalone piece of content, such as a blog post, forum thread, or news article?
4.Which HTML element is used to define additional content related to the main content, such as sidebars, pull quotes, or advertisements?
5.Which HTML element is used to define the closing section of a webpage, typically containing copyright information, contact details, and site-wide navigation links?
6.Which HTML element is used to define a group of content that is related, but can be standalone or nested within another section?
7.Which HTML element is used to define a list of navigation links?
8.Which HTML element is used to define a self-contained composition in a document, such as a poem, a dialogue, or a section of computer code?
9.Which HTML element is used to define a piece of content that is tangentially related to the content around it, such as sidebars, callouts, or advertisements?
10.Which HTML element is used to define a group of content that is related and typically represents a thematic subsection of the document?
Topic:Tables
-
1.Which HTML element is used to create a table?
2.Which HTML element is used to create a table row?
3.Which HTML element is used to create a table cell containing data?
4.What is the purpose of the 'colspan' attribute in HTML table cells?
5.What is the purpose of the 'rowspan' attribute in HTML table cells?
6.Which HTML element is used to create a table header cell?
7.What is the purpose of the 'scope' attribute in HTML table header cells?
8.Which HTML element is used to create a caption for a table?
9.What is the purpose of the 'border' attribute in the <table> element?
10.Which HTML element is used to group the body content of the table?
Topic:HTML5
-
1.Which HTML5 element is used to define a container for navigation links?
2.Which HTML5 element is used to define a section within a document, such as chapters, headers, footers, or any other thematic grouping?
3.Which HTML5 element is used to define self-contained content, such as blog posts, forum threads, or news articles?
4.Which HTML5 element is used to define introductory content or navigation links at the top of a webpage?
5.Which HTML5 element is used to define a group of navigation links?
6.Which HTML5 element is used to define the main content of a webpage, excluding headers, footers, and navigation?
7.Which HTML5 element is used to play audio files on a webpage?
8.Which HTML5 element is used to embed video files on a webpage?
9.Which HTML5 element is used to draw graphics, animations, or other visual images on a webpage?
10.Which HTML5 element is used to define the footer section of a webpage, typically containing copyright information, contact details, and site-wide navigation links?
Topic:Metadata
-
1.Which HTML meta tag is used to specify the character encoding for the document?
2.Which HTML meta tag is used to specify the viewport settings for responsive web design?
3.Which HTML meta tag is used to provide a brief description of the document?
4.Which HTML meta tag is used to specify keywords relevant to the document's content?
5.Which HTML meta tag is used to prevent search engines from indexing the document?
6.Which HTML meta tag is used to specify the author of the document?
7.Which HTML meta tag is used to refresh or redirect the document after a specified time?
8.Which HTML meta tag is used to specify the language of the document?
9.Which HTML meta tag is used to set the character encoding and language of the document?
10.Which HTML meta tag is used to specify the expiration date of the document?
Topic:Validation
-
1.What is the purpose of the HTML validator?
2.Which organization provides an official HTML validation service?
3.What does it mean if an HTML document passes validation?
4.Which type of errors can an HTML validator detect?
5.What is the purpose of using HTML validation tools during web development?
6.Which attribute is used to specify the URL of the validation service in HTML?
7.What is the consequence of invalid HTML code?
8.Which markup language is used for HTML validation?
9.What does an HTML validation error indicate?
10.Which tool can be used to automatically validate HTML code during development?
Topic:
-
1.What HTML attribute is used to provide alternative text for images, ensuring accessibility for users who rely on screen readers?
2.What is the purpose of the 'role' attribute in HTML accessibility?
3.Which HTML element is used to create a label for form elements, improving accessibility by associating text with form controls?
4.What HTML attribute is used to specify the language of the text in an HTML document, enhancing accessibility for users who may require language-specific assistance?
5.Which HTML element is used to group related form elements together, providing accessibility benefits by grouping them with a common purpose?
6.What HTML attribute is used to specify the order in which elements receive focus when navigating using the keyboard, enhancing accessibility for keyboard users?
7.Which HTML element is used to define a navigation section of a webpage, improving accessibility by providing a clear and consistent navigation structure?
8.What is the purpose of the 'aria-label' attribute in HTML accessibility?
9.Which HTML element is used to define the main content of a webpage, excluding headers, footers, and navigation, thus improving accessibility by providing clear content hierarchy?
10.What HTML attribute is used to specify a keyboard shortcut for interactive elements, improving accessibility for keyboard users?
Topic:Responsive Design
-
1.What is responsive design?
2.Which CSS property is commonly used to make websites responsive by adjusting layout and sizing based on the viewport width?
3.What is a media query in CSS used for?
4.Which meta tag is commonly used to ensure proper rendering and scaling on mobile devices?
5.What does the 'flexbox' layout model in CSS offer for responsive design?
6.What is the purpose of using relative units like 'em' or 'rem' in responsive design?
7.What does a fluid layout refer to in responsive design?
8.Which CSS technique is used to hide elements on smaller screens while displaying them on larger screens in responsive design?
9.What is a 'mobile-first' approach in responsive design?
10.How can the 'max-width' property be used in responsive design?
Topic:
-
1.Which HTML input type is used for entering single-line text, such as names or email addresses?
2.Which HTML input type is used for entering email addresses, ensuring that the entered value conforms to the email format?
3.Which HTML input type is used for selecting multiple options from a list of predefined choices?
4.Which HTML input type is used for selecting a single option from a list of predefined choices?
5.Which HTML attribute specifies the URL where the form data will be submitted?
6.Which HTML attribute specifies how form data should be submitted?
7.Which HTML attribute specifies the name of an input field?
8.Which HTML attribute specifies the initial value of an input field?
9.Which HTML input type is used for submitting form data to the server?
10.Which HTML input type is used for resetting form fields to their initial values?
11.Which HTML element is used to define the main content of a webpage?
12.What HTML element is used to define a section within a document, such as chapters, headers, footers, or any other thematic grouping?
13.Which HTML element is used to define self-contained content, such as blog posts, forum threads, or news articles?
14.What HTML element is used to define a container for navigation links?
15.Which HTML element is used to define the footer section of a webpage?
16.What HTML element is used to define introductory content or navigation links at the top of a webpage?
17.Which HTML attribute specifies the URL where the form data will be submitted?
18.What HTML element is used to create a clickable hyperlink?
19.Which HTML attribute provides alternative text for images, aiding accessibility and SEO?
20.Which HTML element is used to create a list of items?
21.What is the recommended way to include external CSS files in an HTML document?
22.What is the preferred method for adding JavaScript code to an HTML document?
23.What is the purpose of the 'alt' attribute in the <img> tag?
24.Which HTML element is used for creating a hyperlink?
25.What is the purpose of the 'title' attribute in HTML?
26.What is the correct way to define a table in HTML?
27.Which tag is used to create a numbered list in HTML?
28.What is the purpose of the 'role' attribute in HTML?
29.What is the recommended way to add comments in HTML?
30.What does the acronym 'SEO' stand for?
31.Which HTML tag is used to include an external CSS file?
32.What is the purpose of the <style> tag in HTML?
33.Which HTML attribute is used to apply inline CSS styles to an element?
34.Which HTML attribute is used to link an HTML element with a JavaScript function?
35.Which HTML tag is used to include an external JavaScript file?
36.What is the purpose of the 'src' attribute in the <script> tag?
37.Which HTML tag is used to define a container for JavaScript code in an HTML document?
38.What is the purpose of the 'defer' attribute in the <script> tag?
39.Which HTML attribute is used to specify the type of content contained in a <script> tag?
40.Which CSS property is used to apply styling to an HTML element when a user hovers over it?