Which HTML5 element is specifically designed for containing tangential content, like a sidebar?
a) <aside>
b) <article>
c) <section>
d) <div>
Answer: a) <aside>
What is the purpose of the aria-label attribute?
a) To style an element
b) To provide a label for assistive technologies (like screen readers)
c) To link a CSS file
d) To create a JavaScript function
Answer: b) To provide a label for assistive technologies (like screen readers)
Which CSS property creates a transparent overlay effect?
a) opacity
b) transparent
c) visibility
d) display
Answer: a) opacity
Which JavaScript method is used to remove the last element from an array?
a) pop()
b) push()
c) shift()
d) slice()
Answer: a) pop()
What does the rel="noopener" attribute in an <a> tag prevent when opening a link in a new tab?
a) It prevents the new page from accessing the window.opener property of the original page for security.
b) It prevents search engines from following the link.
c) It prevents the browser from caching the page.
d) It prevents the link from being styled.
Answer: a) It prevents the new page from accessing the window.opener property of the original page for security.
Which CSS concept allows you to apply styles based on characteristics of the device?
a) Flexbox
b) Media Queries
c) CSS Grid
d) Variables
Answer: b) Media Queries
Which HTML tag is used to define important text, typically displayed in bold by browsers?
a) <important>
b) <b>
c) <strong>
d) <i>
Answer: c) <strong>
What is the default value of the position property in CSS?
a) relative
b) absolute
c) fixed
d) static
Answer: d) static
Which of these is NOT a JavaScript framework/library?
a) React
b) Angular
c) Django
d) Vue.js
Answer: c) Django
What does the target="_blank" attribute do in an <a> tag?
a) Opens the link in the same tab.
b) Opens the link in a new tab or window.
c) Downloads the linked resource.
d) Submits a form.
Answer: b) Opens the link in a new tab or window.
Which CSS selector matches an <input> element that is currently disabled?
a) input:disabled
b) input.disabled
c) input[state="disabled"]
d) input:inactive
Answer: a) input:disabled
What is the purpose of the alt attribute in an <img> tag?
a) To provide a tooltip.
b) To specify the image source.
c) To provide alternative text for accessibility and if the image fails to load.
d) To align the image.
Answer: c) To provide alternative text for accessibility and if the image fails to load.
Which property is used to create a gap between flex items in a flex container?
a) margin
b) padding
c) gap
d) space-between
Answer: c) gap
Which HTML tag is used for the largest heading?
a) <h6>
b) <head>
c) <heading>
d) <h1>
Answer: d) <h1>
What does API stand for in web development?
a) Automated Programming Interface
b) Application Programming Interface
c) Advanced Page Interaction
d) Applied Protocol Integration
Answer: b) Application Programming Interface
Which CSS property controls the stacking order of elements that overlap?
a) stack-order
b) z-index
c) layer
d) position
Answer: b) z-index
Which JavaScript keyword is used to declare a constant variable?
a) let
b) var
c) const
d) constant
Answer: c) const
What is the correct file extension for a JavaScript file?
a) .java
b) .js
c) .javascript
d) .script
Answer: b) .js
Which HTML element is used to specify a header for a document or a section?
a) <head>
b) <header>
c) <heading>
d) <top>
Answer: b) <header>
Which of these is a valid way to include a comment in a CSS file?
a) // This is a comment
b) <!-- This is a comment -->
c) /* This is a comment */
d) ** This is a comment **
Answer: c) / This is a comment */*
What does the this keyword refer to in a JavaScript object method?
a) The function itself
b) The global window object
c) The object that owns the method
d) The parent object
Answer: c) The object that owns the method
Which CSS property is used to change the font of an element?
a) font-family
b) text-style
c) font-style
d) font-weight
Answer: a) font-family
Which HTML tag is used to define a list item?
a) <ul>
b) <ol>
c) <li>
d) <dl>
Answer: c) <li>
What is the purpose of the async attribute in a <script> tag?
a) To make the script execute synchronously.
b) To fetch the script asynchronously and execute it immediately after fetching, without pausing HTML parsing.
c) To delay the script's execution until after the HTML is parsed.
d) To prevent the script from running.
Answer: b) To fetch the script asynchronously and execute it immediately after fetching, without pausing HTML parsing.
Which of these is a core principle of responsive web design?
a) Using only fixed-width layouts.
b) Creating a separate mobile website.
c) Using fluid grids, flexible images, and media queries.
d) Avoiding the use of CSS.
Answer: c) Using fluid grids, flexible images, and media queries.