Web Design on a Mac

Caporegime
Joined
12 Mar 2009
Posts
26,778
Well, please bear with me because I am as new to web development as you can get. I have been trying to get to grips with simple HTML using my MacBook. I have been using TextEdit and then saving the files as a HTML file and then trying to open them up in Safari. I have a problem however that hopefully somebody will be able to explain, It's probably fairly straightforward and I'm probably being really silly, but like I said I'm as green to this as you can get so please be nice. :)

I have the following code typed into TextEdit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<body>
This is my first web page
</body>
</html>
I save that in a folder and I call it "myfirstpage.html" I also save it as a .html filetype.

However, when I try to open it in Safari it shows everything including the tags, so I can't see how the page displays, however, I also have Windows on my MacBook which I booted into and slapped the same code into notepad and opened it with Internet Explorer, hey presto, in Internet Explorer it shows just what I expected to see " This is my first web page".

Can anybody tell me why this isn't happening in OS X and why it is showing all the tags instead of just the content? And could somebody please give me some advice on how to get it to show like it does in Windows, in OS X? I could still learn HTML in Windows, but I much prefer OS X's speed and ease of use. Any help will be much appreciated and I'm sorry if I'm being an absolute lemon.

Cheers! :)
 
Last edited:
TextEdit might be trying to be clever as regards file formats. Look in its preferences and get everything on Plain Text with no messin'.

---

Are you copy and pasting the XHTML bit without understanding what it means? If you're saying that your page is XHTML Strict, then it should conform to the rules of XHTML Strict (you don't have a page title for a start)
 
Thanks for the help Wush, I'll go and have a look at the preferences and see if there are any ways to just get it to set everything to plain text. :)

I copied that code from a tutorial I found online, am I doing that part wrong? I have to admit I know nothing yet, I presumed that everything included in this bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
was to tell the browser which language to look for? Although I do concede that I know nothing and this is my first time trying this. I did dabble in college but that was using a Macromedia Suite that made things easier for me than doing this all manually.

Edit: I've just set it to use plain text and I've just opened the file in Safari, and it works fine!

Thanks for the help and I know that I have no page title, no head, or anything like that. I was just trying something very basic and hopefully with time my skills will improve. I'm still trying to understand the really basic things. Thanks very much for the help mate. :D
 
Last edited:
I presumed that everything included in this bit was to tell the browser which language to look for?
But if you say that you're going to use a certain language, you should actually use it. What followed your first line isn't XHTML Strict :)

Here's a minimal page that is

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>hi</p>
  </body>
</html>

---

It's obviously no big deal at the moment, but if you're going to learn it, you might as well learn it right!
 
Last edited:
TextEdit saves text files in rich text format, not plain text. It's damn annoying. If you want to do serious coding on Mac OS you'll need something like TextMate (I recommend this) or Coda.
 
TextEdit saves text files in rich text format, not plain text. It's damn annoying. If you want to do serious coding on Mac OS you'll need something like TextMate (I recommend this) or Coda.

If you go to Format > Make Plain Text, then it should be okay. But I do have TextWrangler incase things go pear shaped. :)
 
Obligatory vim/emacs mention

Are any of those free to use? As I'm only getting to grips with the basics at the moment I don't want to pay for programs just yet. Although I do have a view to purchase Dreamweaver and Fireworks when my understanding of HTML is half decent enough. I remember using those programs in college and they made web design a doddle. I especially liked using CSS although this was about 3 years ago. 3 years of heavy drinking and gaming does not do wonders for your memory concerning productive things. :(
 
They're built in to OS X, but are terminal programs and quite hard to use.

I'd agree with Xenoxide if and when you feel like moving off of TextEdit. Coda is an impressive app!
 
Back
Top Bottom