HTML Questions
1. What does HTML stand for?
a) High Tech Markup Language
b) Hyperlink and Text Markup Language
➡ c) Hyper Text Markup Language
d) Home Tool Markup Language
2. Which tag is used for inserting a line break in HTML?
➡ a) <br>
b) <lb>
c) <break>
d) <line>
3. Which attribute is used to open a link in a new tab?
a) href="_new"
➡ b) target="_blank"
c) window="_new"
d) open="_new"
4. Which HTML element is used to define important text?
a) <strong>
➡ b) <b>
c) <em>
d) <i>
5. Which of the following is NOT a valid HTML5 tag?
a) <article>
b) <section>
c) <footer>
➡ d) <blink>
6. Which tag is used to create a table header in HTML?
a) <th>
b) <tr>
➡ c) <thead>
d) <td>
7. What does the <canvas> element do in HTML5?
a) Displays videos
b) Embeds images
➡ c) Renders graphics via JavaScript
d) Adds animations
8. Which attribute is used to specify that an input field must be filled out?
➡ a) required
b) validate
c) mandatory
d) checked
9. Which tag is used for embedding audio files?
➡ a) <audio>
b) <sound>
c) <music>
d) <mp3>
10.Which of the following elements represents a self-closing tag in HTML?
➡ a) <input>
b) <p>
c) <div>
d) <span>
CSS Questions
11.Which property is used to change the font of text?
a) text-style
➡ b) font-family
c) text-font
d) font-weight
12.How can you make a background image cover the entire container?
➡ a) background-size: cover;
b) background-size: full;
c) background-fit: cover;
d) background: stretch;
13.Which CSS property controls the space between elements?
➡ a) margin
b) padding
c) border-spacing
d) spacing
14.Which of the following is a valid way to apply multiple background
images in CSS?
a) background-image: url(image1.jpg) + url(image2.jpg);
b) background-image: [image1.jpg, image2.jpg];
➡ c) background-image: url(image1.jpg), url(image2.jpg);
d) background-image: (image1.jpg, image2.jpg);
15.Which CSS property makes an element disappear but still occupy
space?
➡ a) visibility: hidden;
b) display: none;
c) opacity: 0;
d) filter: blur(100%);
16.What is the default position property of an HTML element?
a) absolute
➡ b) static
c) relative
d) fixed
17.Which pseudo-class applies styles when a user hovers over an
element?
➡ a) :hover
b) :focus
c) :active
d) :visited
18.Which value of display property allows elements to be arranged in a
grid layout?
a) inline-block
b) flex
➡ c) grid
d) block
19.Which property is used to change the order of items in a flex container?
a) order-index
➡ b) order
c) position
d) flex-direction
20.What does z-index control?
a) Opacity of elements
b) The rotation of elements
➡ c) The stacking order of elements
d) The spacing between elements
JavaScript Questions
21.Which of the following is a valid JavaScript variable name?
a) 2variable
➡ b) _variableName
c) var-name
d) function
22.Which method is used to remove an element from an array by index?
a) pop()
➡ b) splice()
c) shift()
d) slice()
23.What does typeof NaN return in JavaScript?
a) "null"
➡ b) "number"
c) "undefined"
d) "NaN"
24.Which JavaScript method converts a JSON string into a JavaScript
object?
➡ a) JSON.parse()
b) JSON.stringify()
c) toObject()
d) parseJSON()
25.What will console.log(2 == "2") return?
➡ a) true
b) false
c) undefined
d) Error
26.Which function is used to delay execution of a JavaScript function?
➡ a) setTimeout()
b) setInterval()
c) delay()
d) wait()
27.Which symbol is used for optional chaining in JavaScript?
➡ a) ?.
b) ??
c) =>
d) ::
28.What does the map() function do in JavaScript?
a) Iterates over an array and modifies its elements
➡ b) Creates a new array with modified elements
c) Filters elements in an array
d) Finds an element in an array
29.Which JavaScript keyword is used to handle asynchronous operations?
a) sync
➡ b) async
c) await
d) callback
30.Which method is used to find the index of an element in an array?
a) search()
b) getIndex()
➡ c) indexOf()
d) findIndex()