Answers 100% Pass
What is the role of CSS in the box model?
✔✔CSS defines how elements are rendered in terms of margins, borders, padding, and the actual
content area, affecting layout and spacing.
How can you create a gradient background using CSS?
✔✔You can create a gradient background with the `background-image` property and `linear-
gradient` or `radial-gradient` functions, like `background-image: linear-gradient(to right, red,
blue);`.
What CSS property would you use to control the space between lines of text?
✔✔The `line-height` property is used to control the spacing between lines of text, allowing for
better readability.
How do you implement a responsive design using CSS?
✔✔Responsive design can be implemented using flexible grid layouts, media queries, and
relative units like percentages or `em` for sizing.
1
, How can you style links in different states (like hover or visited) using CSS?
✔✔You can style links in different states by using pseudo-classes like `:hover`, `:active`, and
`:visited`, for example, `a:hover { color: red; }`.
What does the `flexbox` layout model allow you to do in CSS?
✔✔The `flexbox` layout model allows for responsive design by providing a more efficient way
to align and distribute space among items in a container.
How can you create a simple CSS animation for an element?
✔✔You can create a CSS animation by defining keyframes with the `@keyframes` rule and
applying the `animation` property to the element.
What is the difference between `absolute`, `relative`, and `fixed` positioning in CSS?
✔✔`Relative` positioning moves an element relative to its original position, `absolute`
positioning removes it from the document flow, positioning it relative to the nearest positioned
ancestor, and `fixed` positioning keeps the element fixed in the viewport.
How do you create a CSS grid layout?
2