Which tag is the root element of an HTML document?
a) <html>
b) <head>
c) <body>
d) <!DOCTYPE>
Answer: a) <html>
Which tag contains meta-information about the HTML document?
a) <html>
b) <head>
c) <body>
d) <meta>
Answer: b) <head>
Which attribute is used to provide a description of the web page for search engines?
a) name="author"
b) name="description"
c) charset="UTF-8"
d) http-equiv="refresh"
Answer: b) name="description"
Which input type is used for a field that should contain an e-mail address?
a) text
b) email
c) mail
d) url
Answer: b) email
Which attribute restricts the minimum value for a numerical input?
a) minlength
b) minimum
c) min
d) max
Answer: c) min
Which attribute provides a sample value or a short description of the expected input?
a) value
b) sample
c) hint
d) placeholder
Answer: d) placeholder
Which CSS property controls the text size?
a) text-style
b) font-size
c) text-size
d) font-style
Answer: b) font-size
How do you select an element with the id "header" in CSS?
a) #header
b) .header
c) header
d) *header
Answer: a) #header
How do you select elements with the class name "intro"?
a) #intro
b) .intro
c) intro
d) *intro
Answer: b) .intro
Which property is used to change the left margin of an element?
a) margin-left
b) padding-left
c) indent
d) text-indent
Answer: a) margin-left
Which 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 value will make an element positioned relative to the viewport?
a) relative
b) absolute
c) fixed
d) static
Answer: c) fixed
How do you make a list that lists its items with squares?
a) list-type: square;
b) list-style: square;
c) list-style-type: square;
d) list-bullet: square;
Answer: c) list-style-type: square;
In an ordered list, which type attribute value will use uppercase letters?
a) "1"
b) "A"
c) "a"
d) "I"
Answer: b) "A"
Which tag defines an item in a description list that describes the term?
a) <dt>
b) <dd>
c) <dl>
d) <li>
Answer: b) <dd>
Which tag is used to play audio files?
a) <music>
b) <mp3>
c) <sound>
d) <audio>
Answer: d) <audio>
Which attribute specifies that the audio should play automatically?
a) auto
b) autoplay
c) play
d) auto-play
Answer: b) autoplay
Which tag provides fallback content for browsers that do not support the <audio> tag?
a) <noaudio>
b) <fallback>
c) The text between the <audio> and </audio> tags
d) <alternative>
Answer: c) The text between the <audio> and </audio> tags
Which tag defines multiple media resources for media elements?
a) <media>
b) <src>
c) <resource>
d) <source>
Answer: d) <source>
Which attribute of the <video> tag sets the width of the video player?
a) width
b) size
c) horizontal
d) w
Answer: a) width
Which tag is used to define a client-side image map?
a) <map>
b) <image_map>
c) <area>
d) <imagemap>
Answer: a) <map>
Which shape attribute value requires four coordinates?
a) rect
b) circle
c) poly
d) triangle
Answer: a) rect
Which attribute of the <area> tag defines the alternative text for the area?
a) title
b) alt
c) text
d) description
Answer: b) alt
Which tag is used to embed another HTML page within the current page?
a) <frame>
b) <embed>
c) <inline>
d) <iframe>
Answer: d) <iframe>
Which attribute specifies the HTML content of the page to show in the iframe?
a) source
b) content
c) srcdoc
d) src
Answer: c) srcdoc
Where is an internal CSS style sheet defined?
a) In a separate .css file
b) In the <head> section with the <style> tag
c) In the <body> section
d) In the HTML element using the style attribute
Answer: b) In the <head> section with the <style> tag
Which is the correct way to link an external style sheet?
a) <style src="mystyle.css">
b) <link rel="stylesheet" type="text/css" href="mystyle.css">
c) <stylesheet>mystyle.css</stylesheet>
d) <a href="mystyle.css" rel="stylesheet">
Answer: b) <link rel="stylesheet" type="text/css" href="mystyle.css">
Which property is used to change the background color?
a) color
b) bgcolor
c) background-color
d) background-image
Answer: c) background-color
How do you add a background image?
a) background-image: url("image.jpg");
b) background: image("image.jpg");
c) bg-image: url("image.jpg");
d) image: url("image.jpg");
Answer: a) background-image: url("image.jpg");
Which property is used to change the case of text?
a) text-case
b) text-transform
c) font-case
d) case
Answer: b) text-transform
Which property is used to specify the space between lines of text?
a) line-height
b) spacing
c) line-spacing
d) text-spacing
Answer: a) line-height
Which property is used to specify the indentation of the first line of a text?
a) text-indent
b) indent
c) first-line-indent
d) padding-left
Answer: a) text-indent
Which property controls the capitalization of text?
a) text-capitalize
b) text-case
c) text-transform
d) font-variant
Answer: c) text-transform
Which value is used to make text italic?
a) font-style: italic;
b) font-weight: italic;
c) text-style: italic;
d) style: italic;
Answer: a) font-style: italic;
Which property adds space between the words in a text?
a) word-spacing
b) text-spacing
c) spacing
d) letter-spacing
Answer: a) word-spacing
Which property is used to create a transparent effect on an element?
a) transparent
b) opacity
c) visibility
d) clear
Answer: b) opacity
Which property specifies the type of cursor to be displayed?
a) mouse-pointer
b) cursor
c) pointer
d) hover
Answer: b) cursor
Which property is used to create rounded borders?
a) border-round
b) border-radius
c) round-border
d) corner-radius
Answer: b) border-radius
Which property adds shadow to text?
a) text-shadow
b) font-shadow
c) shadow
d) text-effect
Answer: a) text-shadow
Which property is used to control the overflow of content in a box?
a) scroll
b) overflow
c) resize
d) content-flow
Answer: b) overflow
Which value hides an element but keeps the space it occupies?
a) display: none;
b) visibility: hidden;
c) opacity: 0;
d) hidden: true;
Answer: b) visibility: hidden;
Which property specifies the stack order of an element?
a) z-index
b) stack-order
c) layer
d) order
Answer: a) z-index
Which pseudo-class is used to style a link when the mouse is over it?
a) :hover
b) :mouseover
c) :link
d) :active
Answer: a) :hover
Which property is used to specify whether a border should be solid, dashed, or dotted?
a) border-style
b) border-line
c) border-type
d) line-style
Answer: a) border-style
How do you make each word in a text start with a capital letter?
a) text-transform: uppercase;
b) text-transform: lowercase;
c) text-transform: capitalize;
d) text-transform: full-width;
Answer: c) text-transform: capitalize;
Which property is used to specify the space between the cells of a table?
a) cell-spacing
b) border-spacing
c) table-spacing
d) spacing
Answer: b) border-spacing
Which value for the display property generates a block box for the content and an inline box for the list item marker?
a) list-item
b) block
c) inline
d) flex
Answer: a) list-item
Which property allows you to rotate, scale, move, skew, etc., an element?
a) transform
b) transition
c) animation
d) translate
Answer: a) transform
Which property is used with :before and :after pseudo-elements to insert generated content?
a) content
b) insert
c) text
d) add
Answer: a) content
Which value for the position property is NOT affected by the top, bottom, left, and right properties?
a) static
b) relative
c) absolute
d) fixed
Answer: a) static