What does HTML stand for?
a) Hypertext Markup Language
b) Hyperlink and Text Markup Language
c) Home Tool Markup Language
d) Hypertext Transfer Markup Language
Answer: a) Hypertext Markup Language
Which tag is used to create a hyperlink in HTML?
a) <a>
b) <link>
c) <href>
d) <hyperlink>
Answer: a) <a>
Which CSS property is used to change the background color?
a) color
b) bgcolor
c) background-color
d) back-color
Answer: c) background-color
Which HTML tag is used to define an internal style sheet?
a) <css>
b) <script>
c) <style>
d) <link>
Answer: c) <style>
Which HTML attribute is used to define inline styles?
a) class
b) styles
c) font
d) style
Answer: d) style
Which property is used to change the text color in CSS?
a) fgcolor
b) color
c) text-color
d) font-color
Answer: b) color
What does CSS stand for?
a) Creative Style Sheets
b) Cascading Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
Answer: b) Cascading Style Sheets
Which HTML tag is used to define a table?
a) <table>
b) <tab>
c) <tr>
d) <td>
Answer: a) <table>
How can you make a list that lists the items with numbers?
a) <ul>
b) <ol>
c) <list>
d) <dl>
Answer: b) <ol>
Which tag is used to create a drop-down list in HTML?
a) <input>
b) <select>
c) <list>
d) <dropdown>
Answer: b) <select>
What is the correct HTML element for inserting a line break?
a) <br>
b) <break>
c) <lb>
d) <newline>
Answer: a) <br>
Which attribute is used to provide an alternative text for an image, if the image cannot be displayed?
a) title
b) alt
c) src
d) href
Answer: b) alt
Which HTML element is used to specify a footer for a document or section?
a) <bottom>
b) <footer>
c) <section>
d) <end>
Answer: b) <footer>
Which CSS property controls the text size?
a) font-style
b) text-size
c) font-size
d) text-style
Answer: c) font-size
Which tag is used to define a standard cell inside a table in HTML?
a) <tc>
b) <tcell>
c) <td>
d) <th>
Answer: c) <td>
Which HTML element is used to play video files?
a) <media>
b) <video>
c) <movie>
d) <file>
Answer: b) <video>
Which of the following is not a valid HTML5 element?
a) <section>
b) <article>
c) <nav>
d) <blink>
Answer: d) <blink>
Which CSS property is used to change the font of an element?
a) font-family
b) font-weight
c) font-style
d) font-type
Answer: a) font-family
Which JavaScript method is used to write into an alert box?
a) alert()
b) prompt()
c) alertBox()
d) msg()
Answer: a) alert()
Which of the following is the correct syntax to create a function in JavaScript?
a) function myFunction() {}
b) create myFunction() {}
c) function
() {}
d) def myFunction() {}
Answer: a) function myFunction() {}
Which of the following is used to specify the web address in the <a> tag?
a) link
b) href
c) url
d) src
Answer: b) href
What is the correct way to link an external stylesheet in HTML?
a) <style src=”styles.css”>
b) <link rel=”stylesheet” type=”text/css” href=”styles.css”>
c) <stylesheet>styles.css</stylesheet>
d) <css src=”styles.css”>
Answer: b) <link rel=”stylesheet” type=”text/css” href=”styles.css”>
Which CSS property is used to control the layout of items within a container?
a) display
b) float
c) flex
d) position
Answer: c) flex
What is the purpose of the <head> element in an HTML document?
a) To contain the main content of the document
b) To define the body of the document
c) To contain meta-information about the document
d) To display the title of the document
Answer: c) To contain meta-information about the document
What does the z-index property in CSS control?
a) The vertical positioning of an element
b) The horizontal positioning of an element
c) The stacking order of elements
d) The visibility of an element
Answer: c) The stacking order of elements
Which JavaScript method is used to access an HTML element by its ID?
a) getElementById()
b) getElement()
c) querySelector()
d) getElementByClass()
Answer: a) getElementById()
What is the correct way to include JavaScript in an HTML document?
a) <script src=”script.js”></script>
b) <javascript src=”script.js”></javascript>
c) <js src=”script.js”></js>
d) <code src=”script.js”></code>
Answer: a) <script src=”script.js”></script>
Which HTML attribute is used to define inline CSS styles?
a) class
b) style
c) css
d) inline
Answer: b) style
Which of the following is a CSS preprocessor?
a) Sass
b) JavaScript
c) HTML
d) PHP
Answer: a) Sass
What does the position: absolute; CSS property do?
a) Positions an element relative to its parent
b) Positions an element relative to its default position
c) Positions an element relative to the nearest positioned ancestor
d) Positions an element in the middle of the page
Answer: c) Positions an element relative to the nearest positioned ancestor
Which method is used in JavaScript to retrieve elements with a specific class name?
a) getElementsByClassName()
b) getElementsByClass()
c) querySelectorAll()
d) getElements()
Answer: a) getElementsByClassName()
What is the correct syntax for creating a comment in CSS?
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 /
Which HTML element is used to display a scalar measurement within a known range?
a) <progress>
b) <meter>
c) <range>
d) <value>
Answer: b) <meter>
What is the purpose of the <canvas> element in HTML5?
a) To create a drawing area on a web page
b) To display video content
c) To structure the layout of a page
d) To link to external resources
Answer: a) To create a drawing area on a web page
Which attribute specifies the size of an input field in HTML?
a) length
b) size
c) width
d) height
Answer: b) size
Which of the following is a JavaScript library commonly used for DOM manipulation?
a) React
b) Angular
c) jQuery
d) Vue
Answer: c) jQuery
What does the float property do in CSS?
a) It positions an element to the left or right of its container
b) It changes the transparency of an element
c) It aligns text to the center
d) It controls the font size of an element
Answer: a) It positions an element to the left or right of its container
Which of the following is used to style a single element with an ID of “header”?
a) .header { color: blue; }
b) #header { color: blue; }
c) header { color: blue; }
d) *header { color: blue; }
Answer: b) #header { color: blue; }
Which of the following is used to add rounded corners to an element in CSS?
a) border-radius
b) corner-radius
c) border-corner
d) round-corner
Answer: a) border-radius
Which JavaScript event occurs when a user clicks on an HTML element?
a) onchange
b) onmouseover
c) onmouseout
d) onclick
Answer: d) onclick
Which of the following is used to fetch data from an external API in JavaScript?
a) XMLHttpRequest
b) fetch()
c) axios()
d) All of the above
Answer: d) All of the above
What does the term “responsive design” refer to?
a) Designing websites for fast loading times
b) Creating designs that adapt to different screen sizes
c) Designing for accessibility
d) Creating interactive elements
Answer: b) Creating designs that adapt to different screen sizes
Which CSS framework is known for its responsive grid system?
a) Bootstrap
b) Foundation
c) Bulma
d) All of the above
Answer: d) All of the above
Which HTML tag is used to define an unordered list?
a) <ol>
b) <ul>
c) <li>
d) <list>
Answer: b) <ul>
Which CSS property is used to create space between the border and the content of an element?
a) margin
b) padding
c) border-spacing
d) spacing
Answer: b) padding
What does the term “AJAX” stand for?
a) Asynchronous JavaScript and XML
b) Asynchronous Java and XHTML
c) Asynchronous JavaScript and XHTML
d) Active JavaScript and XML
Answer: a) Asynchronous JavaScript and XML
Which of the following is not a valid JavaScript data type?
a) String
b) Number
c) Character
d) Boolean
Answer: c) Character
What is the purpose of the <noscript> tag in HTML?
a) To display alternative content if JavaScript is disabled
b) To include non-JavaScript code
c) To disable JavaScript on the page
d) To link to an external script file
Answer: a) To display alternative content if JavaScript is disabled
Which HTML attribute is used to specify the URL of an image?
a) href
b) src
c) link
d) img
Answer: b) src
What is the purpose of the defer attribute in a script tag?
a) To delay the loading of the script until the entire page is loaded
b) To execute the script immediately
c) To run the script in the background
d) To load the script synchronously
Answer: a) To delay the loading of the script until the entire page is loaded