From the course: CSS Layouts: From Float to Flexbox and Grid
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
The display property - CSS Tutorial
From the course: CSS Layouts: From Float to Flexbox and Grid
The display property
- [Instructor] To make layout changes, many methods, but all, use the display property. The block, inline, and inline-block values change the default display behaviors of elements in the normal flow. display is also used to initiate the Grid and Flexbox layouts, which we'll discuss in more detail later on in this course. Let's open an exercise and test out the different display values. Right now, the elements that I'm using, the section, div, and span, do not have any default margin or padding styles. Let's just add in some background colors to make it easier to see the boundaries of each element. We can also add in the height and width elements, but remember, by default, inline elements will ignore the height and width values. So let's add display with a value of block, first to the inline elements. Now, it will display just like a block element. The height and width is applied, and the elements are stacked. Now,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Inline and block elements1m 53s
-
(Locked)
The box model properties3m 32s
-
(Locked)
The display property5m
-
(Locked)
The box model and layouts3m 17s
-
(Locked)
The float property3m 19s
-
(Locked)
Clearing floats5m 46s
-
(Locked)
Setting up your project3m 8s
-
(Locked)
Exercise: Build a layout with float9m 54s
-
(Locked)
Position: Relative and absolute5m 15s
-
(Locked)
Position: Fixed, sticky, and static4m 31s
-
(Locked)
-
-
-