Who can pls explain me the function of '<span>' tag in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Who can pls explain me the function of '<span>' tag in html

20th Jul 2019, 9:50 PM
Abdelhakim Cube Emp Gu Ayed
Abdelhakim Cube Emp Gu Ayed - avatar
6 Answers
+ 4
I tried hard and put time into this, so I'll still answer it: Mostly inline styling. Let's say you want a word in the middle of your sentence red. If you used div or p, that would make a not-so-nice sentence. But with span, you can style your tags very well and everyone will be happy: https://code.sololearn.com/WYsMTODF6lF3/?ref=app
20th Jul 2019, 9:59 PM
Airree
Airree - avatar
+ 7
Koder King It's not considered spamming. However, we do ask that people search for similar questions to avoid the many, many, many duplicates we're seeing.
20th Jul 2019, 10:07 PM
David Carroll
David Carroll - avatar
+ 3
Nope. This are numerous questions asked by community members previously. You can find them using the search bar.
20th Jul 2019, 9:57 PM
Jella
Jella - avatar
+ 1
As far as I know (and have used it) it's just a placeholder-tag like <div> , but a bit less dynamic. The times I have used span tags is for holding icons (like a x-icon for closing a window or an icon that shows a house to signal 'home' to the user).
20th Jul 2019, 9:52 PM
Roolin
Roolin - avatar
+ 1
U just wrote all of this!
20th Jul 2019, 9:55 PM
Abdelhakim Cube Emp Gu Ayed
Abdelhakim Cube Emp Gu Ayed - avatar
+ 1
I didint know about the search concept But now i know it thx by the way
20th Jul 2019, 10:10 PM
Abdelhakim Cube Emp Gu Ayed
Abdelhakim Cube Emp Gu Ayed - avatar