CSS Assignment More QA
CSS Assignment More QA
A: Padding is the space between the content of an element and its border. It is used to create inner
space within an element, ensuring that the content doesn't touch the edges.
Margin is the space outside the border of an element. It is used to create space between different
elements on a webpage.
Both padding and margin are used to control layout and spacing, with padding affecting the space
Q: What is the display property and explain display inline, block, and inline-block?
A: The display property determines how an element is displayed on the page. Key values:
- Display: inline: Elements are placed inline with the surrounding text. They take up only as much
width as needed.
- Display: block: Elements take up the full width available, forcing a new line break. They can have
- Display: inline-block: Combines characteristics of inline and block elements. Elements remain
- min-height: Sets the minimum height an element can have, preventing it from being smaller than