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

Problem on preview my web site

Hi all,

I took html and css courses, and I am trying to apply these knowledge to create my first web site on sublime test 2. I have typed these code on it but it couldn't preview on google chorm, just wonder is there are something wrong on my code?

<!DOCTYPE html>

<html>

<head> 
    <title> City of Toronto</title>
</head>

<body>
    <header>
        <h1> City of Toronto</h1>
        <h2> by: Edwin Chau </h2>
    </header>

    <p>Toronto, on the north shore of Lake Ontario, is the largest of Canada's vibrant urban centres. It is the hub of the nation's commercial, financial, industrial, and cultural life, and is the capital of the Province of Ontario. People have lived here since shortly after the last ice age, although the urban community only dates to 1793 when British colonial officials founded the 'Town of York' on what then was the Upper Canadian frontier. That backwoods village grew to become the 'City of Toronto' in 1834, and through its subsequent evolution and expansion Toronto has emerged as one of the most liveable and multicultural urban places in the world today. </p>

   <p>This presentation provides general audiences with a summary of the current scholarly consensus on the main themes in Toronto's past, with an emphasis on the characteristics of life here through time as well as the changes, issues, and influences that affected the shared experiences of its residents.</p>

   <p>In addition to facts, historical studies are about interpretation, and there are many ways of viewing our heritage. Therefore, additional presentations on specialized topics will follow in the future, and we hope that other groups will use the Internet and other media to share their stories of Toronto's history in order to broaden the number of voices, increase discussion, and advance historical awareness for everyone's benefit.</p>

</body>
</html>

2 Answers

Robert McCormick
Robert McCormick
4,400 Points

I'm no expert by any means, but your code looks good to me. Did you save your file with the html extension? If not, that could be your problem. Try saving your file as something like, "toronto.html", and see if that helps. You should then be able to right click your file, select "open with", and then choose Chrome or whatever browser you'd like to use.

I hope this helps!

Hi!

It looks like the html opening and closing tags are missing. You should try to add them to your code.

<html>
<title> City of Toronto</title>

<header>
    <h1> City of Toronto</h1>
    <h2> by: Edwin Chau </h2>
</header>

<p>Toronto, on the north shore of Lake Ontario, is the largest of Canada's vibrant urban centres. It is the hub of the nation's commercial, financial, industrial, and cultural life, and is the capital of the Province of Ontario. People have lived here since shortly after the last ice age, although the urban community only dates to 1793 when British colonial officials founded the 'Town of York' on what then was the Upper Canadian frontier. That backwoods village grew to become the 'City of Toronto' in 1834, and through its subsequent evolution and expansion Toronto has emerged as one of the most liveable and multicultural urban places in the world today. </p>

</html>

Can u show which opening and closing tags I am missing? I have checked couple times and did checked at w3c code validation, still can not find out what tags I am missing

Sure! I just added the html tag that goes right after the DOCTYPE declaration. Also you must remember save your code with html extension.

<!DOCTYPE html>
<html>
 <!-- YOUR CODE GOES HERE-->
</html>

Does this answers makes sense? If not I'll try to clarify it more for you.