This chapter marks the start of our discussion of controlling layout.
<aside> <img src="/icons/list_purple.svg" alt="/icons/list_purple.svg" width="40px" />
By the end of this chapter you will:
Up until now, our content has been very one-dimensional down the page. Each block element we added appeared beneath the previous one.
In web development and design, "layout" refers to the arrangement of elements on a web page. It encompasses the way content is structured and presented to users, including text, images, buttons, and other content and interactive elements. A well-designed layout ensures that information is structured in a scannable way (and therefore easy to find) and aesthetically pleasing (in terms of balance), improving the user's experience and interaction with the website.
Layout design involves several key considerations:
<div>, and semantic elements like header, footer, nav, <section>, <article>, and <aside>. (We'll talk about semantic elements in the next chapter.)We won't cover all of these ideas today, but these themes will re-emerge in subsequent chapters as we learn of several ways that different layout approaches‡ can be described in CSS. CSS plays the fundamental role in implementing web layouts, and affords us a wide range of approaches to control the positioning, spacing, and sizing of elements.
<aside> <img src="/icons/light-bulb_blue.svg" alt="/icons/light-bulb_blue.svg" width="40px" />
‡ Learning how to "lay content out" with CSS will help us better embrace our screen real-estate. While there are a range of ways to move content around a screen, Flexbox and Grid are two modern CSS layout models that provide detailed control over complex layouts, and make it easy to create responsive and adaptive designs.
</aside>