Here are Top 50 multiple-choice questions (MCQs) focused on the HTML5 features and elements in CSS (Cascading Style Sheets) MCQs, along with their answers and explanations.
1. Which CSS property is used to set the style of an element's text?
- text-decoration
- font-style
- text-align
- line-height
The font-style property is used to set the style of an element's text, such as "italic" or "oblique."
2. Which CSS property is used to control the space between lines of text in an element?
- line-height
- font-weight
- text-transform
- letter-spacing
The line-height property controls the space between lines of text within an element.
3. What does the CSS property text-transform do?
- Changes the color of the text
- Transforms the text to uppercase or lowercase
- Sets the font size of the text
- Adjusts the letter spacing
The text-transform property is used to transform the text to uppercase, lowercase, or other capitalization styles.
4. Which CSS property is used to specify the thickness of an element's font characters?
- font-size
- font-weight
- font-style
- line-height
The font-weight property is used to specify the thickness of an element's font characters, such as "bold."
5. What does the CSS property text-decoration control?
- The text's color
- The text's alignment
- Decoration styles like underline, overline, and line-through
- The text's size
The text-decoration property controls decoration styles like underline, overline, and line-through for text.
6. What does the CSS property letter-spacing control?
- The space between words
- The space between lines
- The space between letters in a text
- The space between paragraphs
The letter-spacing property controls the space between letters in a text.
7. Which CSS property is used to specify the font size of an element's text?
- font-weight
- font-style
- font-size
- line-height
The font-size property is used to specify the font size of an element's text.
8. What does the font-family property specify in CSS?
- The style of the text
- The color of the text
- The typeface or font family to be used for the text
- The alignment of the text
The font-family property specifies the typeface or font family to be used for the text.
9. Which CSS property is used to set the color of an element's text?
- font-color
- text-color
- color
- font-style
The color property is used to set the color of an element's text.
10. What does the text-align property control in CSS?
- The space between lines
- The text's size
- The alignment of text within an element
- The text's style
The text-align property controls the alignment of text within an element, such as "left," "right," "center," or "justify."
11. Which CSS property is used to set the style of an element's font characters to italic or oblique?
- font-style
- font-italic
- font-transform
- font-weight
The font-style property is used to set the style of an element's font characters to italic or oblique.
12. What does the font-variant property control in CSS?
- The capitalization of text
- The color of the text
- The font size
- The letter spacing
The font-variant property controls the capitalization of text, such as "small-caps."
13. Which CSS property is used to set the thickness of an element's text characters to a lighter or bolder style?
- font-weight
- font-style
- font-transform
- font-variant
The font-weight property is used to set the thickness of an element's text characters to a lighter or bolder style.
14. What does the font-stretch property control in CSS?
- The width of text characters
- The color of the text
- The letter spacing
- The text alignment
The font-stretch property controls the width of text characters, allowing for variations like "condensed" or "expanded."
15. In CSS, what does the property font-size-adjust control?
- The color of text
- The size of text
- The height of lowercase letters
- The adjustment of letter spacing
The font-size-adjust property in CSS controls the adjustment of the font size to achieve a consistent height for lowercase letters, particularly in fonts that vary in x-height.
16. What does the text-overflow property control in CSS?
- The overflow of text beyond the element's boundary
- The transformation of text to uppercase or lowercase
- The color of text
- The space between lines of text
The text-overflow property in CSS controls the behavior of text when it overflows the element's boundary, typically in the context of ellipsis for truncated text.
17. What does the word-spacing property control in CSS?
- The color of text
- The space between lines of text
- The alignment of text
- The space between words in text
The word-spacing property in CSS controls the space between words in text.
18. What does the text-rendering property control in CSS?
- The rendering quality of text
- The font size of text
- The text color
- The text alignment
The text-rendering property in CSS controls the rendering quality of text, allowing for optimizations in text display.
19. Which CSS property is used to set the style of an element's underline for text?
- text-underline-style
- text-decoration-line
- text-underline-color
- text-decoration-style
The text-decoration-style property is used to set the style of an element's underline for text, such as "solid," "dotted," or "dashed."
20. In CSS, what does the text-overflow property value "ellipsis" indicate?
- Text is displayed without any overflow
- Text is transformed to uppercase
- Text is displayed with an ellipsis (...) when it overflows
- Text is aligned to the center of the element
In CSS, the text-overflow property value "ellipsis" indicates that text is displayed with an ellipsis (...) when it overflows the element.
21. Which CSS property is used to control the alignment of text within an element in the horizontal direction?
- text-align
- text-indent
- text-transform
- line-height
The text-align property is used to control the alignment of text within an element in the horizontal direction.
22. What does the font-kerning property control in CSS?
- The space between lines of text
- The space between words
- The adjustment of letter spacing
- The rendering quality of fonts
The font-kerning property in CSS controls the adjustment of letter spacing, particularly for fine-tuning the spacing between specific letter pairs.
23. In CSS, what does the text-transform value "capitalize" do?
- Transforms text to lowercase
- Transforms text to uppercase
- Transforms the first character of each word to uppercase
- Transforms text to italics
In CSS, the text-transform value "capitalize" transforms the first character of each word to uppercase.
24. What does the font-variant value "small-caps" do in CSS?
- Reduces the font size
- Displays all text in uppercase
- Converts all text to lowercase
- Converts lowercase letters to small capitals
The font-variant value "small-caps" in CSS converts lowercase letters to small capitals, maintaining the font size.
25. Which CSS property is used to set the thickness of an element's text characters to a lighter or bolder style?
- font-weight
- font-style
- font-transform
- font-variant
The font-weight property is used to set the thickness of an element's text characters to a lighter or bolder style.
26. Which CSS property is used to control the case of text, making it all uppercase or lowercase?
- text-case
- text-transform
- text-style
- font-case
The text-transform property is used to control the case of text, transforming it to uppercase, lowercase, or other capitalization styles.
27. What does the text-decoration value "line-through" do in CSS?
- Adds an underline to the text
- Adds a line through the text, striking it out
- Makes the text bold
- Rotates the text
In CSS, the text-decoration value "line-through" adds a line through the text, striking it out.
28. Which CSS property is used to control the spacing between lines of text in an element, and is often expressed as a relative value?
- font-size
- line-height
- text-align
- letter-spacing
The line-height property is used to control the spacing between lines of text in an element, and it's often expressed as a relative value, such as "1.5" times the font size.
29. What does the CSS property font-variant value "normal" indicate?
- Displays text in small capitals
- Applies a specific font style
- Renders text in bold
- Maintains the default text style
In CSS, the font-variant value "normal" indicates that text maintains the default text style, without applying small capitals or other variants.
30. Which CSS property is used to control the space between words in a block of text?
- word-spacing
- letter-spacing
- text-decoration
- font-style
The word-spacing property is used to control the space between words in a block of text.
31. In CSS, what does the property font-size-adjust do?
- Adjusts the font size of text
- Controls the color of text
- Sets the height of lowercase letters
- Transforms text to uppercase
In CSS, the font-size-adjust property sets the height of lowercase letters, particularly in fonts that vary in x-height.
32. What does the CSS property text-decoration-line control?
- The color of text
- The alignment of text
- Decoration styles like underline, overline, and line-through
- The thickness of text characters
The text-decoration-line property controls decoration styles like underline, overline, and line-through for text.
33. Which CSS property is used to set the alignment of text within an element in the vertical direction?
- vertical-align
- text-transform
- line-height
- text-align
The vertical-align property is used to set the alignment of text within an element in the vertical direction.
34. What does the text-overflow property value "clip" indicate in CSS?
- Text is displayed with an ellipsis (...) when it overflows
- Text is transformed to uppercase
- Text is displayed without any overflow
- Text is aligned to the center of the element
In CSS, the text-overflow property value "clip" indicates that text is displayed without any overflow.
35. What does the letter-spacing value "normal" indicate in CSS?
- No letter spacing is applied
- Maximum letter spacing is applied
- All letters are transformed to lowercase
- All letters are transformed to uppercase
In CSS, the letter-spacing value "normal" indicates that no additional letter spacing is applied beyond the default spacing.
36. Which CSS property is used to control the color of an element's text?
- text-color
- font-color
- color
- text-style
The color property is used to control the color of an element's text.
37. In CSS, what does the text-align property value "justify" do?
- Aligns text to the left
- Aligns text to the right
- Aligns text to the center
- Justifies text, creating even spacing between words
In CSS, the text-align property value "justify" justifies text, creating even spacing between words and aligning it to both the left and right margins.
38. What does the font-variant value "small-caps" do in CSS?
- Reduces the font size
- Displays all text in uppercase
- Converts all text to lowercase
- Converts lowercase letters to small capitals
The font-variant value "small-caps" in CSS converts lowercase letters to small capitals, maintaining the font size.
39. What does the font-stretch value "ultra-condensed" indicate in CSS?
- The text is condensed to a minimal width
- The text is expanded to a maximum width
- The text is displayed in lowercase
- The text is displayed in uppercase
In CSS, the font-stretch value "ultra-condensed" indicates that the text is condensed to a minimal width.
40. What does the word-spacing value "inherit" indicate in CSS?
- The space between words is set to a fixed value
- The space between words is set to the default value
- The space between words inherits the value from the parent element
- The space between words is reduced to zero
In CSS, the word-spacing value "inherit" indicates that the space between words inherits the value from the parent element.
41. Which CSS property is used to control the space between lines of text in an element?
- line-height
- letter-spacing
- text-transform
- font-weight
The line-height property is used to control the space between lines of text within an element.
42. In CSS, what does the text-align property value "right" do?
- Aligns text to the left
- Aligns text to the center
- Aligns text to the right
- Justifies text
In CSS, the text-align property value "right" aligns text to the right within the element.
43. What does the font-size-adjust value "none" indicate in CSS?
- No font size adjustment is applied
- All text is displayed in uppercase
- All text is transformed to lowercase
- The font size is reduced to the minimum value
In CSS, the font-size-adjust value "none" indicates that no adjustment to the font size is applied.
44. Which CSS property is used to control the case of text, transforming it to lowercase?
- text-case
- text-transform
- text-style
- font-case
The text-transform property is used to control the case of text, including the transformation to lowercase.
45. In CSS, what does the text-align property value "center" do?
- Aligns text to the left
- Aligns text to the right
- Aligns text to the center
- Justifies text
In CSS, the text-align property value "center" aligns text to the center within the element.
46. What does the text-decoration value "overline" do in CSS?
- Adds an underline to the text
- Adds a line through the text, striking it out
- Adds a line above the text
- Rotates the text
In CSS, the text-decoration value "overline" adds a line above the text.
47. Which CSS property is used to control the vertical alignment of an inline element with respect to its parent element's baseline?
- vertical-align
- text-align
- line-height
- text-transform
The vertical-align property is used to control the vertical alignment of an inline element with respect to its parent element's baseline.
48. What does the text-overflow value "ellipsis" indicate in CSS?
- Text is displayed without any overflow
- Text is transformed to uppercase
- Text is displayed with an ellipsis (...) when it overflows
- Text is aligned to the center of the element
In CSS, the text-overflow value "ellipsis" indicates that text is displayed with an ellipsis (...) when it overflows the element.
49. Which CSS property is used to control the case of text, making it all uppercase or lowercase?
- text-case
- text-transform
- text-style
- font-case
The text-transform property is used to control the case of text, transforming it to uppercase, lowercase, or other capitalization styles.
50. In CSS, what does the line-height property value "normal" indicate?
- No line spacing is applied
- Maximum line spacing is applied
- Minimum line spacing is applied
- Line spacing is adjusted based on the font size
In CSS, the line-height property value "normal" indicates that line spacing is adjusted based on the font size and other factors.