Login | Register | FAQ
Anonymous

Create your first website doesn't work

+ Post a reply

Page 1 of 1


Create your first website doesn't work

by newbee » Fri Jun 22, 2012 1:07 am

I am an absolute newbee to coding so please forgive me for a really basic question.

I have just finished Lesson 4. I am sure I have followed the lesson to the letter, saving my text file from TextEdit on my Mac as a .html file.

However, when I open it in a browser, it just looks the same as it does in TextEdit. I am sure I am doing something quite fundamentally wrong. The code I have saved ispasted below. Can anyone see what I have done wrong?

<html>

<head>
<title>My First Website</title>
</head>

<body>
<p>Hurrah! This is my website</p>
</body>

</html>
User avatar

newbee

  • Posts: 2
  • Joined: Fri Jun 22, 2012 1:01 am

Re: Create your first website doesn't work

by newbee » Fri Jun 22, 2012 3:04 am

Sensational!!! Thank you CubeSquare, this has worked a treat!

Bring on Lesson 6!

;-)
User avatar

newbee

  • Posts: 2
  • Joined: Fri Jun 22, 2012 1:01 am

Re: Create your first website doesn't work

by pmlearn » Mon Jun 25, 2012 1:28 am

Thanks newbee for asking and Thanks cubesquare for answering. I an new as well and have a macbook and I don't have luck.

I did what the Dave website suggested but I am still looking the element and content and tags instead of the actual web page.

When I double click to open page1.htm, it gives me the source code with <html> ... </html> when "Ignore rich text commands in HTML files" is unchecked. When I checked this box, quit textedit and reopened my page1.htm, I got a even more complicated source code with more coding lines like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.36">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="Apple-converted-space">     </span>&lt;html&gt;</p>
<p class="p2"><br></p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;head&gt;</p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;title&gt;My first website &lt;/title&gt;</p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;/head&gt;</p>
<p class="p2"><br></p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;body&gt;</p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;p&gt;Hurrah! This is my website.&lt;/p&gt;</p>
<p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-converted-space">  </span>&lt;/body&gt;</p>
<p class="p2"><br></p>
<p class="p1"><span class="Apple-converted-space">     </span>&lt;/html&gt;</p>
</body>
</html>

Help, what I am doing wrong?
Regards;
pmlearn
User avatar

pmlearn

  • Posts: 2
  • Joined: Mon Jun 25, 2012 1:12 am

Re: Create your first website doesn't work

by XainPro » Mon Jun 25, 2012 4:50 am

This is not good because the program wants to work with Rich Text Format, not plain text (the ruler is the giveaway). To fix that, go to Format --> Make Plain Text
Now, almost done (and you only have to go through this once: once the file is properly named, TextEdit will remember for future edit sessions). Choose File --> Save As... and type in a filename that includes a ".html" filename extension.
Yes, it's a bit of a pain, but, as I said, you only have to do this once, when you first save the file, and from then on, it'll work transparently.
User avatar

XainPro

  • Posts: 3308
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: Create your first website doesn't work

by pmlearn » Wed Jun 27, 2012 3:56 am

Thank You so much. It works this time. I like this site and I am learning. Very much appreciate the support.
User avatar

pmlearn

  • Posts: 2
  • Joined: Mon Jun 25, 2012 1:12 am

Re: Create your first website doesn't work

by XainPro » Wed Jun 27, 2012 4:27 am

My Pleasure....
User avatar

XainPro

  • Posts: 3308
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1