From the course: Responsive Layout

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display property

Display property - HTML Tutorial

From the course: Responsive Layout

Start my 1-month free trial

Display property

- [Instructor] One property you'll use a lot is the Display property. This has to do with how an element will take up space on the page. There are several different possible values, but these are the ones you'll use most often to do layouts, display: inline, block, inline-block, flex, and grid. Every element on your page starts out as a rectangle. Inline elements are usually bits of text. For example, a span, a strong, an M element. Inline means the element is in line with other text and doesn't break the flow of text going from left to right. You can add margin and padding to an inline element, but it will remain in line with the other text, and these only effect the horizontal flow of text. You can't add vertical margin or padding. An inline element will also ignore a height or width attribute. Block elements take up a block of area on the page. Examples are a paragraph, a H1, a dib, or structural elements like section or nab. Block elements by default take up the full width of…

Contents