Member-only story
HTML — Part-4
8 min readMay 7, 2022
HTML Block and Inline Elements
- There are two display values: block and inline.
- Every HTML element has a default display value, depending on what type of element it is.
Block-level Elements
- A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.
- A block-level element always takes up the full width available.
<p>
and<div>
.
Inline Elements
- An inline element does not start on a new line.
- An inline element only takes up as much width as necessary.
<div> amd <span>
- The
<div>
element is a block-level and is often used as a container for other HTML elements - The
<span>
element is an inline container used to mark up a part of a text, or a part of a document
HTML class Attribute
- specify a class for an HTML element.
- multiple and different HTML elements can share the same class.
- It can also be used by a JavaScript to access and manipulate elements with the specific class name with the…