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

HTML

Should I use <span> tag instead of <p> tag for short amounts of text?

Is it appropriate to wrap short sentences in <span> tag or any block of text should be in <p> tag?

1 Answer

Consider that by default the display setting of a <span> is inline whereas for <p> it is block. I wouldn't make a decision of whether or not to use a <p> or a <span> based on the length of the text but rather based on what layout and styling I'm trying to achieve. Typically I use a <span> to apply a different style to text within a block element such as a <p>.