Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialParker Arbuthnot
1,969 PointsWhat does the "Span" element do?
I am confused to what the Span element does. If someone could go in-depth, explaining what it did, it would be extremely helpful! Thanks!
2 Answers
ilyas kerbal
18,816 PointsThe 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.
Personally, I use span to style text inside div or any other elements. For example:
<div class="game">Orioles <span>Vs</span> Yankees</div>
Now I can target the span inside the .game and style it.
Omar Jimenez
1,446 PointsGroups text for styling purposes. It is a inline element which means it sets within a line of text.
Parker Arbuthnot
1,969 PointsParker Arbuthnot
1,969 PointsOh!! Okay, thank you so much!