To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Element positioning

There are different ways elements can be displayed.

Elements can follow two formats in particular, but there are more. These display styles are a bit more CSS than HTML but by default, it is included as part of HTML.

Block

A display block, is an element that will follow a vertical structure. A block has a width of 100%, and prevents any elements being at either the left or right hand side of it. That's basically how they work.

Examples of block elements include h1, h2, h3, h4, h5, h6, p, div and hr.

This is a block element.
This is also a block element.

Inline

An inline element is one that follows after another and does not break the continious line. For instance, an inline element is one which flows horizontally. Placing an inline element in an element such as a paragraph will not make the paragraph take a new line.

Examples of inline elements include the a, img, span, input and textarea.

This is an inline element. This is also an inline element.
Provide feedback on this page
Comments are sent via email to me.