Right Answer: Semantic HTML elements are tags that clearly describe their meaning in a human- and machine-readable way, such as `<header>`, `<article>`, `<footer>`, and `<section>`. They are important because they improve accessibility, enhance SEO, and make the structure of the web page clearer for developers and browsers.
Right Answer: The box model in CSS describes the rectangular boxes generated for elements in a document tree and consists of four areas: content, padding, border, and margin. The content is the innermost area, surrounded by padding, then the border, and finally the margin, which is the outermost area.
Right Answer: Block elements take up the full width available and start on a new line (e.g., `<div>`, `<h1>`). Inline elements only take up as much width as necessary and do not start on a new line (e.g., `<span>`, `<a>`). Inline-block elements are similar to inline elements but can have width and height set, and they respect margins and padding (e.g., `<img>`, `<button>`).
Right Answer: Flexbox, or the Flexible Box Layout, is a CSS layout model that allows items in a container to be arranged and aligned efficiently. It works by defining a container as a flex container using `display: flex;`, which enables its direct children (flex items) to be laid out along a main axis (horizontal or vertical). You can control the alignment, direction, spacing, and size of these items using properties like `flex-direction`, `justify-content`, `align-items`, and `flex-wrap`. This makes it easier to create responsive layouts without using floats or positioning.
Right Answer: Synchronous code executes sequentially, meaning each operation must complete before the next one starts. Asynchronous code allows operations to run independently, enabling other tasks to proceed without waiting for the previous ones to finish.