So far, we have mostly seen "block" elements. They appear on the next line, like paragraphs.
There are also "inline" elements. They appear on the same line that they are written on.
img
, a
, br
, em
, strong
p
, h1
, ul
, li
, almost everything else.span
span
is rendered next to surrounding content, and only wraps when it reaches the edge of the containing element.span is used to apply a specific style inline
.highlight {
color: teal;
}
<p>Paragraph with <span class="highlight">teal</span> text.</p>
Paragraph with teal text.