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!

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 Inline and Internal Styles

Is the space after the colon in "background-color: orange" recommended for best practice? It still works without space.

For inline styling.

2 Answers

Jason Anders
Jason Anders
Treehouse Moderator 145,855 Points

Hi Hae,

For the most part, whitespace in CSS / HTML does not matter. So, yes, either will work just fine. As Thomas Hooper stated, it is mostly for readability, but it is also the more common practice.

:) :dizzy:

Mod Note: Moved Thomas' response from Comments to Answers

Thomas Hooper
Thomas Hooper
15,557 Points

I'd say it is for readability reasons.