Professional Documents
Culture Documents
Advanced CSS Quiz
Advanced CSS Quiz
Advanced CSS Quiz
11. What is the di erence between `display: inline`, `display: block`, and `display: inline-block`?
- Answer: `display: inline` makes an element behave like an inline element, `display: block`
makes it a block-level element, and `display: inline-block` allows it to ow inline while retaining
block properties.
15. What are CSS variables and how do you use them?
- Answer: CSS variables (custom properties) are de ned with `--` and accessed using the `var()`
function. Example: `--main-color: #333;`, `color: var(--main-color);`
16. Explain the di erence between `absolute`, `relative`, ` xed`, and `sticky` positioning in CSS.
- Answer: `absolute` positions relative to the nearest positioned ancestor, `relative` positions
relative to itself, ` xed` positions relative to the viewport, and `sticky` toggles between relative and
xed based on scroll position.
These questions cover a broad range of CSS topics and can be useful for testing or improving
knowledge in CSS.
fi
fl
fi
ff
ff
fl
fi
fi
fi
fi
ff
fl
fi
fi
fl
fl
fl
fl
fi