Share
Explain the difference between inline and block-level elements in CSS.
Question
- A. inline elements always start on a new line; block elements do not.
- B. Inline elements have a fixed width; block elements do not.
- C. Inline elements flow horizontally; block elements start on a new line and fill the parent width.
- D. Inline elements have a default margin; block elements do not.
View Answer
correct Answer ( C )
Inline elements only take up as much width as necessary and do not start on a new line. They flow horizontally within their parent container. Block-level elements always begin on a new line and stretch to fill the width of their parent container . This fundamental difference affects how elements are arranged on a page . Inline elements are typically used for text-level elements , while block-level elements are used for larger structural elements . This understanding is crucial for building effective and well-structured web pages .