Margin, Padding, and White Space

💡 The Concept White Space White space (also called white space) is the empty, unmarked, or blank area between and around the design elements in a layout: text, images, buttons, and everything else. It improves readability, creates balance, and highlights key content. White space is not always white. While often referred to as “white space,”…

Read More

The Display Property

💡 The Concept The CSS display property controls how an element participates in page layout, and it is one of the most important properties in CSS. Every HTML element has a default display value. Most are either block or inline, and understanding the difference explains why some elements stack vertically while others sit side by…

Read More

Centering Content with CSS

💡 The Concept Knowing how to center elements with CSS is one of those fundamentals that comes up in nearly every project you build. If you’ve ever stared at a web page wondering why your content is stubbornly hugging the left side of the screen, you’re not alone. Centering content is one of the most…

Read More

The Box Model

💡 The Concept Now that you know how to use padding and margin, it helps to understand the system behind them. Every HTML element on the page is a rectangular box. The CSS Box Model describes the four layers that make up that box, from the inside out: Content: the text, image, or other content…

Read More

Making Elements Disappear with CSS

💡 The Concept In the previous lesson on The Display Property, you worked with display: block, display: inline, and display: inline-block. This lesson covers one more value: display: none, which removes an element from the layout completely. It takes up no space and is invisible to the user, as if it were not in the…

Read More

CSS Float: How to Wrap and Position Elements

💡 The Concept The CSS float property is one of the original layout tools in CSS, still useful today for wrapping text around images. The float property pushes an element to the left or right side of its container so that surrounding text wraps around it. It was originally designed to replicate the print layout…

Read More