Back to Freecodecamp

Learn Block and Inline Lesson B

curriculum/challenges/english/blocks/top-learn-block-and-inline/6570447de7b02272663824e0.md

latest1.3 KB
Original Source

--description--

Inline elements, however, do not start on a new line. They appear in line with whatever elements they are placed beside. A clear example of an inline element is a link, or <a> tag. If you stick one of these in the middle of a paragraph of text, it will behave like a part of the paragraph. <a href="https://www.freecodecamp.org/" target="_blank">(Like this)</a> The link’s text will sit alongside other words in that paragraph. Additionally, padding and margin behave differently on inline elements. In general, you do not want to try to put extra padding or margin on inline elements.

--assignment--

Search the web for a list of block elements and a list of inline elements.

--questions--

--text--

What is the difference between a block element and an inline element?

--answers--

block elements are displayed without line breaks, while inline elements are displayed with line breaks.


block elements take up the full width available, while inline elements only take up the space necessary for their content.


block elements are always positioned horizontally, while inline elements are positioned vertically.


block elements are used for small sections of text, while inline elements are used for larger chunks of content.

--video-solution--

2