CSS (Properties, Functions, Elements, & Tables) 3 — Questions and Answers
Question 1: Which CSS function is used to apply a linear color transition across an element's background?
- color-mix()
- linear-gradient() (Correct answer)
- rgb()
- blur()
Correct answer: linear-gradient()
linear-gradient() creates a smooth transition between two or more colors along a straight line.
Question 2: What does the CSS property 'display: none' do?
- Makes the element transparent
- Removes the element from the page layout entirely (Correct answer)
- Centers the element
- Hides only the text
Correct answer: Removes the element from the page layout entirely
display: none removes the element from the layout, as if it were not in the document.
Question 3: Which element groups the header content of an HTML table?
- <tbody>
- <thead> (Correct answer)
- <tfoot>
- <caption>
Correct answer: <thead>
<thead> groups the header rows of a table for structure and styling.
Question 4: What unit represents a percentage of the viewport's width in CSS?
- px
- em
- vw (Correct answer)
- pt
Correct answer: vw
vw (viewport width) equals 1% of the browser viewport's width.
Question 5: Which property would you use to round the corners of a box?
- corner-radius
- border-radius (Correct answer)
- round-edge
- box-curve
Correct answer: border-radius
border-radius rounds the corners of an element's outer border edge.
Question 6: What does the 'z-index' property control?
- Horizontal position
- Stacking order of overlapping elements (Correct answer)
- Zoom level
- Text size
Correct answer: Stacking order of overlapping elements
z-index sets the stack order of positioned elements that overlap.
Question 7: Which CSS property makes a table's cell borders merge into a single border?
- border-merge: on
- border-collapse: collapse (Correct answer)
- border-spacing: 0
- table-layout: fixed
Correct answer: border-collapse: collapse
border-collapse: collapse merges adjacent cell borders into one shared border.
Which CSS function is used to apply a linear color transition across an element's background?