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

BLOCKED > Is textedit for MAC bad to use for HTML?

Hi Guys,

I am kind of blocked before of some stuff I m not able to do on text edit for mac. I have one file html I called index5.html, and want to insert an other page html in it called index6.html.

I dont know how to do this... I ve checked at various forum on the internet and didn't find out any good answer.

Is it because it s not the best option to use HTML ? Can you help me to insert this other file in it? Or tell me another app to use? (i m on MAC).

THANKS !

5 Answers

Erik McClintock
Erik McClintock
45,783 Points

Charlotte,

TextEdit (or any other text editor) is perfectly fine to use for writing HTML and CSS. The trick is knowing the right code to put into those editors to make them do what you want!

In the case of linking one page to another, it's really quite simple. In your example, it sounds like you have one HTML page (called index5.html) and another (called index6.html), and you want to be able to get TO index6.html FROM index5.html. To do that, say from a navigation menu, you could do the following:

...doctype and head tags would go up here...
<body>
    <nav>
    <ul class="main-nav">
        <li><a href="index6.html">This link will go to index6.html</a></li>
    </ul>
    </nav>
</body>

The key thing to note is that in your anchor (a) tag, the href attribute is set to the "index6.html" filename that you want this link to direct you to. If you had more files, say index7.html, index8.html, and index9.html, you would simply add those as follows:

...doctype and head tags would go up here...
<body>
    <nav>
    <ul class="main-nav">
        <li><a href="index6.html">This link will go to index6.html</a></li>
        <li><a href="index7.html">This link will go to index7.html</a></li>
        <li><a href="index8.html">This link will go to index8.html</a></li>
        <li><a href="index9.html">This link will go to index9.html</a></li>
    </ul>
    </nav>
</body>

Notice all you have to do is change what file the href attribute points to, and you're good to go! You've now linked to 4 other HTML files from your index5.html file, and it can all be done just as easily in TextEdit as in any other editor.

Hope this helps!

Erik

Erik McClintock
Erik McClintock
45,783 Points

As an aside, Jennifer listed some other great alternatives to TextEdit, but it's important to understand that it's not the editor you use that makes the code, it's you! The bells and whistles that other editors may offer can be great and save you a lot of time and headache, HOWEVER, it's best to only use those types of programs and features once you understand the basics. If you jump right into using an editor that has, say, a basic autocomplete feature when you're typing before you understand and remember what you would want to type anyway, you're doing yourself a disservice and potentially hindering your ability to learn, as you can rely on the crutch of the advanced editor to do the remembering for you.

You may not always have the luxury of using a fancier editor, so it's a great idea to use a basic editor (like TextEdit on your Mac, or NotePad on Windows) when you're just getting started to help you learn and remember the necessary components to the language(s) you're trying to learn.

Happy coding!

Erik

Hi Erik - That is a GREAT point about the auto-complete feature, I hadn't thought of that. Is it possible to turn that feature off? I originally learned to code on text edit as well, but I found that once I started working with a color coded text editor, I was able to learn how everything was structured much easier ... but I'm a visually-oriented learner, so maybe it's just me :-)

Erik McClintock
Erik McClintock
45,783 Points

Jennifer,

In most programs, you can turn the auto complete functionality off, but it usually requires going into settings files and editing code that, certainly for beginners, could be an uncomfortable process.

For example, in Sublime Text 2:

https://www.sublimetext.com/docs/2/auto_complete.html

That said, I do agree that the color coding is nice and adds to the efficiency and legibility of code, especially once your documents get a bit larger, and I definitely love how it looks (good ol' Monokai Bright, for me!), though I'd still advocate to hold off on getting into a fancier editor until you've gotten the basics down. Too many features and options (even basic ones like syntax highlighting) can spell a myriad of distractions that take focus away from the most important part of the practice: the language itself!

I'd suggest gaining an understanding of the language's syntax and best practices first, then find a tool to help you write it more quickly (such as Emmet - oh, my, how I love Emmet...).

But, just my opinion! To each their own :)

Erik

Very good points.

P.S. I'm a Monokai Bright girl myself :-)

Hi Charlotte,

I'm not sure what you mean when you say you want to insert another html page inside of an html page.

As far as using text edit, I would recommend using another text editor while you are learning because the color coding of the different tags can really help and I don't think text edit offers that. Some good ones for a Mac are:

Sublime Text 2, TextMate, or TextWrangler

Good luck!

Hi Jennifer and Erik ,

Erik thanks for your tips !! Actually, I ve downloaded Sublimetext2, and I drag my textedit file in HTML in the sublime editor and it works easily !! But Ill try out your coding stuff with only text edit!!

Thanks a lot for this huge detailed and helpful answer !!!

Best,

Charlotte

Erik McClintock
Erik McClintock
45,783 Points

Charlotte,

Absolutely! Always a pleasure to be able to help somebody else with a problem that we've all encountered before when starting out :)

Everything will come together as you get more practice in!

Erik

Oh, and just the thing I wanted to do is [alt text](problemindex.png "indexscreenshot")