This forum is now read-only. Please use our new forums! Go to forums
What does the span tag do?
Can you explain the span tag to me in a little more information?
Answer 502ad79ab78f680002029ca4
The span
tag is like the div
tag. It has no meaning at all and is mostly used for styling by using an id or class. The difference between the two is that div
is a block element, It’s on a seperate line. span
however is an inline element, meaning that it can be on a line with other elements.
Example: span
<span>I will display inline next to the b tag</span><b>I will display next to the span tag</b>
div
<div>I will display as a block element on my own line, above the b tag</div><b>I will display beneath the div tag</b>
You could style them using id’s or classes like this:
html
<span id="changeColor">I'm gonna change!</span>
css
#changeColor {
color:red;
}
That’s about it. Hope this helped, just ask if you have more questions.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
Thank you so much. You had not only answer my question but also added alot of details I didn’t even ask for. Thank you once again.
You welcome