Computer

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

Answer
a) Hyper Text Markup Language

Which of the following is used to style an HTML document?
a) HTML
b) JavaScript
c) CSS
d) PHP

Answer
c) CSS

Which of the following is a client-side scripting language?
a) PHP
b) JavaScript
c) Ruby
d) Python

Answer
b) JavaScript

Which tag is used to create a hyperlink in HTML?
a) <link>
b) <a>
c) <href>
d) <hyperlink>

Answer
b) <a>

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”>

Answer
b) <link rel=”stylesheet” href=”style.css”>

Which of the following is used to create a form in HTML?
a) <form>
b) <input>
c) <button>
d) <textbox>

Answer
a) <form>

Which tag is used to define an unordered list in HTML?
a) <ol>
b) <ul>
c) <list>
d) <li>

Answer
b) <ul>

Which HTML element is used to define the title of a document?
a) <title>
b) <head>
c) <h1>
d) <header>

Answer
a) <title>

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

Answer
a) It provides metadata about the HTML document

Which of the following is used to make a web page interactive?
a) HTML
b) JavaScript
c) CSS
d) XML

Answer
b) JavaScript

Which of the following CSS properties is used to change the background color?
a) background-color
b) bg-color
c) color
d) background

Answer
a) background-color

Which HTML tag is used to display an image?
a) <image>
b) <img>
c) <src>
d) <picture>

Answer
b) <img>

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

Answer
a) To define a section or block-level element

Which property is used to change the font size in CSS?
a) font-style
b) font-weight
c) font-size
d) text-size

Answer
c) font-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

Answer
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

Answer
b) It contains metadata and links to external resources

Which of the following is used to specify the structure of a website?
a) HTML
b) CSS
c) JavaScript
d) Python

Answer
a) HTML

Which of the following is the correct HTML element to create a table?
a) <table>
b) <tr>
c) <td>
d) <table-row>

Answer
a) <table>

Which of the following is used to define an ordered list in HTML?
a) <ul>
b) <li>
c) <ol>
d) <list>

Answer
c) <ol>

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 */

Answer
b) <!– 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

Answer
a) Cascading Style 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

Answer
a) color

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

Answer
b) To link to an external CSS file

Which attribute is used to specify the source of an image in HTML?
a) source
b) src
c) href
d) img-src

Answer
b) src

Which of the following is used to create a comment in CSS?
a) // Comment
b) /* Comment */
c) <!– Comment –>
d) # Comment

Answer
b) /* Comment */

What is the correct HTML tag to define the header of a document?
a) <header>
b) <head>
c) <h1>
d) <title>

Answer
a) <header>

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

Answer
a) To define the position of an element

Which HTML tag is used to display a form control for user input?
a) <button>
b) <input>
c) <textarea>
d) <select>

Answer
b) <input>

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

Answer
c) It uniquely identifies an element

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;

Answer
a) text-align: center;

What is the default display value for <div> elements in CSS?
a) block
b) inline
c) inline-block
d) none

Answer
a) block

Which of the following HTML tags is used to create a section in a webpage?
a) <section>
b) <div>
c) <article>
d) <header>

Answer
a) <section>

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

Answer
c) To allow text to wrap around an element

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button