Looking for the best explanation of how to use the <span> tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Looking for the best explanation of how to use the <span> tag

23rd Oct 2021, 6:31 PM
galiwango Joseph
galiwango Joseph - avatar
3 Answers
+ 2
In HTML, the span tag is a generic inline container element. Span tags usually wrap sections of text for styling purposes or for adding attributes to a section of text without creating a new line of content. The span element is called “generic” because the name of the tag itself doesn’t tell us anything about the contents of the element. In other words, “span” doesn’t mean anything to us. The opposite of a generic HTML element is a semantic HTML element, one whose name describes its purpose (e.g., <p> for paragraph, <button>).
23rd Oct 2021, 8:18 PM
Matias
Matias - avatar
+ 1
Please always tag the language you're asking about. https://code.sololearn.com/W3uiji9X28C1/?ref=app
23rd Oct 2021, 6:44 PM
Simon Sauter
Simon Sauter - avatar
0
Span is used to "select" part of text, to style it with css, or select this and change value using JavaScript
23rd Oct 2021, 7:02 PM
PanicS
PanicS - avatar