<span> | Sololearn: Learn to code for FREE!
- 1

<span>

Does anyone know what <span></span> does in HTML?

30th May 2022, 11:53 PM
XinTong Li
2 Respostas
+ 4
Span tags are used in order to create an inline piece of text with different formatting. It is meant to be used within other elements as a way to add extra detail to something being displayed. For example, you might want to change the color of only one word within a line of text, and the span element is designed for this (because it keeps everything on the same line). Here are some examples: <p>Here is a sentence, but I want <span style="color: blue;">this</span> word to be blue.</p> <p>I also would like a <span style="font-size: 50px;">big</span> word.</p>
30th May 2022, 11:58 PM
Daniel C
Daniel C - avatar
+ 2
Thank you so much
31st May 2022, 2:15 AM
XinTong Li