Introduction to Web Development MCQs with Answers
What does HTML stand for?
a) Hyper Text Markup Language
b) Hyper Transfer Markup Language
c) Home Tool Markup Language
d) Hyperlink Markup Language
Which of the following is used to style an HTML document?
a) HTML
b) JavaScript
c) CSS
d) PHP
Which of the following is a client-side scripting language?
a) PHP
b) JavaScript
c) Ruby
d) Python
Which tag is used to create a hyperlink in HTML?
a) <link>
b) <a>
c) <href>
d) <hyperlink>
What is the correct syntax to link an external CSS file in HTML?
a) <style href=”style.css”>
b) <link rel=”stylesheet” href=”style.css”>
c) <css href=”style.css”>
d) <script src=”style.css”>
Which of the following is used to create a form in HTML?
a) <form>
b) <input>
c) <button>
d) <textbox>
Which tag is used to define an unordered list in HTML?
a) <ol>
b) <ul>
c) <list>
d) <li>
Which HTML element is used to define the title of a document?
a) <title>
b) <head>
c) <h1>
d) <header>
What does the <meta> tag provide in an HTML document?
a) It provides metadata about the HTML document
b) It creates a link to an external CSS file
c) It embeds an image in the document
d) It creates a heading in the document
Which of the following is used to make a web page interactive?
a) HTML
b) JavaScript
c) CSS
d) XML
Which of the following CSS properties is used to change the background color?
a) background-color
b) bg-color
c) color
d) background
Which HTML tag is used to display an image?
a) <image>
b) <img>
c) <src>
d) <picture>
What is the purpose of the <div> tag in HTML?
a) To define a section or block-level element
b) To create a link
c) To display an image
d) To create a button
Which property is used to change the font size in CSS?
a) font-style
b) font-weight
c) font-size
d) text-size
Which of the following is used to apply a CSS style to a specific HTML element?
a) Class selector
b) ID selector
c) Element selector
d) All of the above
What is the purpose of the <head> tag in HTML?
a) It defines the document body
b) It contains metadata and links to external resources
c) It creates the main content of the page
d) It defines the page title
Which of the following is used to specify the structure of a website?
a) HTML
b) CSS
c) JavaScript
d) Python
Which of the following is the correct HTML element to create a table?
a) <table>
b) <tr>
c) <td>
d) <table-row>
Which of the following is used to define an ordered list in HTML?
a) <ul>
b) <li>
c) <ol>
d) <list>
How can you include a comment in an HTML document?
a) // This is a comment
b) <!– This is a comment –>
c) # This is a comment
d) /* This is a comment */
What does CSS stand for?
a) Cascading Style Sheets
b) Creative Style Sheets
c) Computer Style Sheets
d) Cascading Simple Sheets
Which of the following CSS properties is used to change the text color?
a) color
b) text-color
c) font-color
d) text-style
What is the purpose of the <link> tag in HTML?
a) To create a hyperlink to another page
b) To link to an external CSS file
c) To define the header of the page
d) To include a JavaScript file
Which attribute is used to specify the source of an image in HTML?
a) source
b) src
c) href
d) img-src
Which of the following is used to create a comment in CSS?
a) // Comment
b) /* Comment */
c) <!– Comment –>
d) # Comment
What is the correct HTML tag to define the header of a document?
a) <header>
b) <head>
c) <h1>
d) <title>
What is the purpose of the position property in CSS?
a) To define the position of an element
b) To set the element’s display style
c) To create space between elements
d) To change the element’s font size
Which HTML tag is used to display a form control for user input?
a) <button>
b) <input>
c) <textarea>
d) <select>
What does the id attribute do in HTML?
a) It defines a class for the element
b) It creates a hyperlink
c) It uniquely identifies an element
d) It specifies the source of an image
Which of the following is used to align text to the center in CSS?
a) text-align: center;
b) text-align: middle;
c) align-text: center;
d) text-align: center-align;
What is the default display value for <div> elements in CSS?
a) block
b) inline
c) inline-block
d) none
Which of the following HTML tags is used to create a section in a webpage?
a) <section>
b) <div>
c) <article>
d) <header>
What is the purpose of the float property in CSS?
a) To float an element on the screen
b) To position an element at the top
c) To allow text to wrap around an element
d) To make an element visible or invisible