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 can I fix the errors in html and css? Do I have to redo it?

I completed the html and css sections but my webpage has errors in the code. How can I fix them without having to redo it?

Do you mean the HTML and CSS in your Workspace has errors? If that's where you were working, you can simply open up the Workspace and fix the errors, and you can certainly re-watch any of the videos again if you need help or a refresher.

Hi Lindsay,

As Bryan H mentioned, post the errors you're getting in the validator

Also, it would be helpful to post your html as well.

See this thread for how to do that: https://teamtreehouse.com/forum/posting-code-to-the-forum

5 Answers

Yes, in Workspaces. I'm not sure what they are. The site that looks for errors found several when I copied the code into it. Those are the errors I want to fix.

You're talking about the W3C Validator? If you are, could you post the errors you're getting so we can help you out with those?

These are the messages I'm getting. Looks like I should replace the font but I;m not sure about the section lacking a header.

Validation Output: 1 Error

Error Line 7, Column 171: Bad value http://fonts.googleapis.com/css?family=Oswald:400,300|Raleway:400,300,500,900|Changa+One|Open+Sans:700italic,400,600,700 for attribute href on element link: Illegal character in query: not a URL code point. …0|Changa+One|Open+Sans:700italic,400,600,700' 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 27, Column 15: Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections. <section> ✉

I ran into something similar and found that changing the '|' pipe character with '%7C' helped the Validator like my html and returned no errors.

Daniel Politz
Daniel Politz
6,338 Points

I am having the same issue at the moment. Changing the pipe character as Tim suggested did not work.

Here is my code which is exactly as Nick's look from what I can see:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Daniel Politz %7C Photographer</title> <link rel="stylesheet" href="css/normalize.css"> <link href='http://fonts.googleapis.com/css family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/responsive.css">

Here is the error message:

Error Line 7, Column 141: Bad value http://fonts.googleapis.com/css family=Changa+One|Open+Sans:400italic,700italic,400,700,800 for attribute href on element link: Illegal character in path segment: not a URL code point. …ne|Open+Sans:400italic,700italic,400,700,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.

Daniel, in the code you've posted, you didn't change the pipe characters to %7C in the Google Fonts link.

Daniel Politz
Daniel Politz
6,338 Points

Like this? Here is code and error. Made the change but still getting an error.

<!DOCTYPE html>
<html>
  <head>
   <meta charset="utf-8">
   <title>Daniel Politz | Photographer</title>
   <link rel="stylesheet" href="css/normalize.css"> 
   <link href='http://fonts.googleapis.com/css family=Changa+One%7COpen+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
   <link rel="stylesheet" href="css/main.css">
   <link rel="stylesheet" href="css/responsive.css">                             
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>  

Error Line 7, Column 144: Bad value http://fonts.googleapis.com/css family=Changa+One%7C Open+Sans:400italic,700italic,400,700,800 for attribute href on element link: Illegal character in path segment: not a URL code point. …7C Open+Sans:400italic,700italic,400,700,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.

Daniel Politz
Daniel Politz
6,338 Points

Ah! Got it. I had to enter a '?' within the code like this as well as change up the pipe character:

 <link href='http://fonts.googleapis.com/css?family=Changa+One%7COpen+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>

Thanks for the help Bryan.