Web Development MCQs with Answer
What does HTML stand for in web development?
a) Hyperlinks and Text Markup Language
b) Hyper Text Markup Language
c) High Technical Markup Language
d) Home Tool Markup Language
Answer: b) Hyper Text Markup Language
Which of the following is used for styling web pages?
a) HTML
b) CSS
c) JavaScript
d) PHP
Answer: b) CSS
What is the purpose of JavaScript in web development?
a) To define the structure of a web page
b) To style the elements of a web page
c) To add interactivity and dynamic behavior to web pages
d) To manage server-side operations
Answer: c) To add interactivity and dynamic behavior to web pages
Which of the following is NOT a web development framework?
a) Angular
b) React
c) Django
d) Bootstrap
Answer: d) Bootstrap
What is the purpose of the <head> tag in HTML?
a) To define the main content of the web page
b) To include external JavaScript files
c) To define the header section of the web page
d) To provide metadata and link to external resources
Answer: d) To provide metadata and link to external resources
Which programming language is commonly used for server-side web development?
a) JavaScript
b) HTML
c) PHP
d) CSS
Answer: c) PHP
What does CSS stand for in web development?
a) Creative Style Sheets
b) Cascading Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
Answer: b) Cascading Style Sheets
Which of the following is NOT a valid CSS selector?
a) .class
b) #id
c) <element>
d) element.class
Answer: c) <element>
What is the purpose of the box model in CSS?
a) To define the layout of the web page
b) To style text and fonts
c) To create animations and transitions
d) To define the spacing and dimensions of elements
Answer: d) To define the spacing and dimensions of elements
Which of the following is NOT a valid HTTP status code?
a) 200
b) 404
c) 503
d) 800
Answer: d) 800
What does the term “responsive web design” refer to?
a) Designing websites that respond to user input
b) Designing websites that are compatible with older browsers
c) Designing websites that adapt to different screen sizes and devices
d) Designing websites with dynamic content
Answer: c) Designing websites that adapt to different screen sizes and devices
What is the purpose of the <canvas> element in HTML?
a) To display images
b) To embed audio and video content
c) To create graphics and animations using JavaScript
d) To define tables and tabular data
Answer: c) To create graphics and animations using JavaScript
Which of the following is NOT a valid method for including CSS in an HTML document?
a) External CSS file
b) Inline CSS
c) Internal CSS
d) Embedded CSS
Answer: d) Embedded CSS
What is the purpose of the <script> tag in HTML?
a) To define the structure of a web page
b) To include external JavaScript files
c) To define the header section of the web page
d) To provide metadata and link to external resources
Answer: b) To include external JavaScript files
What does SEO stand for in web development?
a) Search Engine Optimization
b) Secure External Operations
c) Server Extension Operations
d) Systematic Encoding Operations
Answer: a) Search Engine Optimization
Which of the following is NOT a valid HTML tag?
a) <div>
b) <span>
c) <article>
d) <format>
Answer: d) <format>
What is the purpose of the viewport meta tag in HTML?
a) To specify the character encoding of the web page
b) To define the title of the web page
c) To set the initial scale and dimensions for mobile devices
d) To include external CSS files
Answer: c) To set the initial scale and dimensions for mobile devices
What is the purpose of AJAX in web development?
a) To create animations and transitions
b) To validate form inputs on the client side
c) To enable asynchronous communication between the client and server
d) To define the layout of the web page
Answer: c) To enable asynchronous communication between the client and server
Which of the following is NOT a valid HTTP request method?
a) GET
b) POST
c) PUT
d) CREATE
Answer: d) CREATE
What is the purpose of a web server in web development?
a) To manage client-side scripting languages
b) To process server-side requests and responses
c) To define the layout and styling of web pages
d) To create animations and transitions
Answer: b) To process server-side requests and responses
Which of the following is NOT a valid type of CSS measurement unit?
a) pixels (px)
b) inches (in)
c) points (pt)
d) degrees (deg)
Answer: d) degrees (deg)
What does the term “HTTP” stand for?
a) Hyperlink Transfer Protocol
b) Hyper Transfer Protocol
c) Hypertext Transfer Protocol
d) Hyperlink Transport Protocol
Answer: c) Hypertext Transfer Protocol
What is the purpose of a web framework?
a) To define the structure of a web page
b) To manage client-side scripting languages
c) To provide pre-built tools and libraries for web development
d) To create graphics and animations using JavaScript
Answer: c) To provide pre-built tools and libraries for web development
What is the purpose of the <form> element in HTML?
a) To define a section of navigation links
b) To create interactive forms for user input
c) To include external CSS files
d) To define the structure of a web page
Answer: b) To create interactive forms for user input
Which of the following is NOT a valid CSS property?
a) background-color
b) font-family
c) text-decoration
d) image-source
Answer: d) image-source
What is the purpose of the alt attribute in HTML <img> tags?
a) To define the alignment of the image
b) To specify the image source URL
c) To provide alternative text for the image
d) To control the size of the image
Answer: c) To provide alternative text for the image
What is the purpose of the z-index property in CSS?
a) To control the transparency of elements
b) To define the stacking order of positioned elements
c) To specify the size of the border around elements
d) To set the initial scale and dimensions for mobile devices
Answer: b) To define the stacking order of positioned elements
Which of the following is NOT a valid HTML form element?
a) <input>
b) <form>
c) <select>
d) <button>
Answer: b) <form>
What is the purpose of the src attribute in HTML <script> tags?
a) To specify the image source URL
b) To define the alignment of the image
c) To include external JavaScript files
d) To control the size of the image
Answer: c) To include external JavaScript files
Which of the following is NOT a valid CSS display property value?
a) block
b) inline
c) column
d) flex
Answer: c) column
What is the purpose of the <meta> tag in HTML?
a) To define the structure of a web page
b) To include external CSS files
c) To provide metadata about the web page
d) To create interactive forms for user input
Answer: c) To provide metadata about the web page
Which of the following is NOT a valid CSS pseudo-class?
a) :hover
b) :active
c) :click
d) :focus
Answer: c) :click
What is the purpose of the href attribute in HTML <a> tags?
a) To specify the image source URL
b) To define the alignment of the image
c) To provide alternative text for the image
d) To specify the URL of the linked page or resource
Answer: d) To specify the URL of the linked page or resource
What is the purpose of the rel attribute in HTML <link> tags?
a) To define the structure of a web page
b) To specify the relationship between the current document and the linked resource
c) To provide metadata about the web page
d) To create interactive forms for user input
Answer: b) To specify the relationship between the current document and the linked resource
What is the purpose of the target attribute in HTML <a> tags?
a) To specify the image source URL
b) To define the alignment of the image
c) To provide alternative text for the image
d) To specify where the linked page will open
Answer: d) To specify where the linked page will open
Which of the following is NOT a valid HTML event attribute?
a) onclick
b) onsubmit
c) onstyle
d) onmouseover
Answer: c) onstyle
What is the purpose of the alt attribute in HTML <img> tags?
a) To define the alignment of the image
b) To specify the image source URL
c) To provide alternative text for the image
d) To control the size of the image
Answer: c) To provide alternative text for the image
Which of the following is NOT a valid CSS unit of measurement?
a) em
b) rem
c) pt
d) dp
Answer: d) dp
What is the purpose of the border-box value for the box-sizing property in CSS?
a) The width and height properties include the padding and border, but not the margin
b) The width and height properties include the padding, border, and margin
c) The width and height properties include the padding, but not the border and margin
d) The width and height properties include the border and margin, but not the padding
Answer: a) The width and height properties include the padding and border, but not the margin
Which of the following is NOT a valid CSS positioning property value?
a) static
b) relative
c) absolute
d) dynamic
Answer: d) dynamic
What is the purpose of the float property in CSS?
a) To clear floated elements
b) To specify whether an element should float to the left or right
c) To set the width of an element
d) To control the transparency of elements
Answer: b) To specify whether an element should float to the left or right
What is the purpose of the display property in CSS?
a) To control the visibility of an element
b) To specify the alignment of an element
c) To define the layout behavior of an element
d) To set the font size of an element
Answer: c) To define the layout behavior of an element
What is the purpose of the position property in CSS?
a) To set the width and height of an element
b) To control the stacking order of an element
c) To specify whether an element should float to the left or right
d) To define the positioning behavior of an element
Answer: d) To define the positioning behavior of an element
What does the term “DOM” stand for in web development?
a) Document Object Model
b) Document Organization Markup
c) Display Object Model
d) Data Object Management
Answer: a) Document Object Model
What is the purpose of the margin property in CSS?
a) To specify the space between the border and content of an element
b) To specify the space between elements
c) To define the layout behavior of an element
d) To control the transparency of elements
Answer: b) To specify the space between elements
Which of the following is NOT a valid CSS background property?
a) background-color
b) background-image
c) background-position
d) background-text
Answer: d) background-text
What is the purpose of the overflow property in CSS?
a) To control the visibility of an element
b) To specify the alignment of an element
c) To define the layout behavior of an element
d) To control the behavior of content that overflows its container
Answer: d) To control the behavior of content that overflows its container
What is the purpose of the visibility property in CSS?
a) To control the display behavior of an element
b) To specify whether an element should float to the left or right
c) To define the stacking order of an element
d) To control the visibility of an element
Answer: d) To control the visibility of an element
What does the term “API” stand for in web development?
a) Application Programming Interface
b) Application Protocol Interface
c) Advanced Programming Interface
d) Advanced Protocol Interface
Answer: a) Application Programming Interface
What is the purpose of the font-family property in CSS?
a) To specify the size of the font
b) To define the layout behavior of an element
c) To set the color of the text
d) To specify the typeface or font family for text
Answer: d) To specify the typeface or font family for text