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 trial

CSS CSS Basics (2014) Getting Started with CSS External Style Sheets

Shaked Gvirtsman
Shaked Gvirtsman
2,270 Points

What is the "span" element

I have seen an element named "span" in the video. Maybe someone here can help me understand what it means?

1 Answer

Aakash Srivastava
Aakash Srivastava
5,415 Points

Hey Shaked Gvirtsman ,
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.
Ex: 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.