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 HTML Text Preformatted Text

<pre></pre>

I have used tab in "It is ... preformatted!" However, when I refreshed my page, it showed like this: It is... preformatted! It's only when I used space then it followed the format. Why is there a difference between these two?

Please add your codes here for us to see. :) Thank you..

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>My Page</title>
    </head>
    <body>      
        <p>When we use the <code>drive()</code> function on the <code>vehicle</code> object, it moves forward.</p>      
        <pre>
            Here is some text.

            It is...
                preformatted!
        </pre>  
    </body>
</html>

I have followed the same code given in the video.

2 Answers

Now I know why the tab and space make the web page look different. In notepad, the tab doesn't equal to 2 spaces as like what we set in the workspace at treehouse here. That's why just one tab, it will show what I need for the web page.

Hmmm. Seems fine to me. Maybe browser issue? I might be wrong.