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 How to Make a Website HTML First Use HTML Elements

Spaces between attributes and "=" invalid?

I prefer to make spaces between property/attributes/... and the "=" for aesthetic reasons but the code challenge did not let me go on with those spaces.

So my question is: are spaces around "=" invalid in HTML?

Example:

meta charset = "utf-8"

2 Answers

Interesting question Katsumi Suno. I can't seem to find anything specific in the HTML 5.1 Specification that would suggest this is invalid and in fact the W3C Validator seems to be fine with spaces. That being said it's fairly uncommon to see spaces used in this way.

Maybe Nick Pettit can comment on to if this is something we need to look into with regards to code challenges?

I just find it easier to distinguish the different elements. To me, it looked kinda strange to push attribute, equal sign and value to one piece of text/code. I like it when it "breathes" ;)

Anyway, just as you checked the specifications, I found out that it works with spaces within the Workspace but not in the code challenge...

Sorry, the above post should've been a comment :( I'm new to this form of forum...