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
Kevin Scanlon
1,248 PointsCode Validation Errors
Hi:
I've run my code through the validation service that Nick recommends and I received three errors. I thought I entered the code exactly as Nick did, so I think missed something simple. I've included a codepen link with my code and the three errors. Can someone help me make sense of the Code Checker Errors? Thanks!
Kevin
http://codepen.io/librariankevin/pen/GsKvj
Validation Output: 3 Errors Error Line 7, Column 147: Bad value http://fonts.googleapis.com/css?family=Hammersmith+One|Open+Sans:400italic,600italic,400,600,800 for attribute href on element link: Illegal character in query: not a URL code point. …ne|Open+Sans:400italic,600italic,400,600,800' rel='stylesheet' type='text/css'>
Syntax of URL:Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20. Warning Line 28, Column 19: Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections. <section>
✉
Error Line 45, Column 121: Bad value img/twitter logo.png for attribute src on element img: Illegal character in path segment: not a URL code point. …in"><img src="img/twitter logo.png" alt="Twitter Logo" class="social-icon"></a>
Syntax of URL:Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20. Error Line 46, Column 118: Bad value img/facebook logo.png for attribute src on element img: Illegal character in path segment: not a URL code point. …"><img src="img/facebook logo.png" alt="Facebook Logo" class="social-icon"></a>
Syntax of URL:Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.
1 Answer
Jason Anello
Courses Plus Student 94,610 PointsHi Kevin,
The 1st error on the google fonts url is because of the vertical bar, |.
This is considered an unsafe character and should be url encoded. You can replace all occurrences of it with %7C
Your 2nd and 3rd errors are because you have a space in your filename for both your facebook and twitter images. You can url encode spaces but I would recommend that you always avoid spaces in file paths and names. You can use an underscore or hyphen anywhere you'd like a space.
Also, your filenames are different from the project. Did you change the image names to match?
In this project they were: src="img/twitter-wrap.png" and src="img/facebook-wrap.png"
You can ignore the warning about "section lacks heading..." In this case you only have the gallery with no heading.
Kevin Scanlon
1,248 PointsKevin Scanlon
1,248 PointsThank you Jason!
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsYou're welcome.