very basic web help

Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
I know on a pc you can write html code in note pad, save it as html document and then open it in a web brouser to see how it looks.

I tried doing this on by writing html code in textedit, saving as an html and then opening it in safari but nothing shows at all or if i save it in other formats then you can see the tags from html code. please help me where I am going wrong. I want to start writing code on my mac :)
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
Are you saving the file as a text file or leaving it to the defauly RTF dormat

Any way Text Wrangler from bare bones is a better text editor, especuially for html code

Bare Bones Software | TextWrangler
 
OP
G
Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
well regardless of what I do now how do I do it so I can see it on safari when I open it?
 
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
After entering your HTML code in TextEdit, click on "save as" from the "File" menu. Uncheck "Hide extension" at the left bottom left corner and type the name of the desired filename at the top with the ".html" extension (I tried saving the file with UTF-8 encoding, and it worked perfectly).

If safari is not your default browser, then secondary click (command+click) on the file that you just saved and chose "safari" from the "Open with" menu.
 
OP
G
Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
After entering your HTML code in TextEdit, click on "save as" from the "File" menu. Uncheck "Hide extension" at the left bottom left corner and type the name of the desired filename at the top with the ".html" extension (I tried saving the file with UTF-8 encoding, and it worked perfectly).

If safari is not your default browser, then secondary click (command+click) on the file that you just saved and chose "safari" from the "Open with" menu.

I tried this and open with safari and it shows all the html tags. I dont understand it.
 
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
I tried this and open with safari and it shows all the html tags. I dont understand it.

Could you post at least a small snippet of your code here?
 
OP
G
Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
sure I was just doing a very very basic code to see how to get started

<html>
<body>
<h1>
Hello. Does it work this time?
<h1/>
<body/>
<html/>




I keep trying but to no avail :(
 
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
There is a weird (?) thing about opening a file with ".html" extension using TextEdit --- it opens up as an HTML document (you're in a kind of WYSIWYG mode), but you really want to open it as a plain text in order to able to edit it using your own HTML tags. Here's a workaround:

1. Open TextEdit
2. Insert the above HTML code that you just posted
3. Go to format on the menubar and select "Make plain text"
4. Then save the file as "filename.html" using "Save as" option under "File".
5. Open "filename.html" with Safari.

I'm very sure that the problem you're seeing is because you're editing in HTML mode. So before entering your code make sure you are in the plain text mode. Let me know if it works. Good luck!
 
Joined
Aug 20, 2005
Messages
739
Reaction score
8
Points
18
Location
Redlands, CA
Your Mac's Specs
Macbook Pro 15" 2ghz/2GB/250gb/SD - White Macbook 2.16ghz/2.5GB/250GB/SD
sure I was just doing a very very basic code to see how to get started

<html>
<body>
<h1>
Hello. Does it work this time?
<h1/>
<body/>
<html/>




I keep trying but to no avail :(
Your coding is wrong to start with... here is how it should look.
PHP:
<html>
<head>
</head>
<body>
<h1>
Hello. Does it work this time?
</h1>
</body>
</html>

You have your "/" on the wrong side.
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
First: Stop using TextEdit (as others have said) :)

Next, this is the key if you must use TextEdit:
3. Go to format on the menubar and select "Make plain text"
 
OP
G
Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
There is a weird (?) thing about opening a file with ".html" extension using TextEdit --- it opens up as an HTML document (you're in a kind of WYSIWYG mode), but you really want to open it as a plain text in order to able to edit it using your own HTML tags. Here's a workaround:

1. Open TextEdit
2. Insert the above HTML code that you just posted
3. Go to format on the menubar and select "Make plain text"
4. Then save the file as "filename.html" using "Save as" option under "File".
5. Open "filename.html" with Safari.

I'm very sure that the problem you're seeing is because you're editing in HTML mode. So before entering your code make sure you are in the plain text mode. Let me know if it works. Good luck!


sweet worked like a charm :) I am now going to try build a forum from scratch. bit stuck with the php at the moment though lol
 
Joined
Aug 20, 2005
Messages
739
Reaction score
8
Points
18
Location
Redlands, CA
Your Mac's Specs
Macbook Pro 15" 2ghz/2GB/250gb/SD - White Macbook 2.16ghz/2.5GB/250GB/SD
sweet worked like a charm :) I am now going to try build a forum from scratch. bit stuck with the php at the moment though lol

That's a bit much isn't it? Not saying it couldn't be done, but that's a lot of PHP/mySQL coding.
 
OP
G
Joined
Nov 6, 2008
Messages
122
Reaction score
0
Points
16
ya it is a lot but hey its my goal eventually as a project

hey I saved the tags and text in textedit AND OPENED IT IN SAFARI WHICH WAS GREAT BUT THEN WHEN I OPEN IT IN text edit it doesnt show the tags i.e. opens it as a web page. what is going on?
 
Joined
Mar 9, 2004
Messages
9,065
Reaction score
331
Points
83
Location
Munich
Your Mac's Specs
Aluminium Macbook 2.4 Ghz 4GB RAM, SSD 24" Samsung Display, iPhone 4, iPad 2
ya it is a lot but hey its my goal eventually as a project

hey I saved the tags and text in textedit AND OPENED IT IN SAFARI WHICH WAS GREAT BUT THEN WHEN I OPEN IT IN text edit it doesnt show the tags i.e. opens it as a web page. what is going on?
You probably need to switch to plain text mode again.

But seriously, stop using textedit for that type of work. Get one of the free programming text editors made for that type of work.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top