Forum Moderators: open

Message Too Old, No Replies

Very Novice Question

How to Edit HTML on a PC

         

peterinwa

8:19 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



I taught myself HTML and JavaScript on WebTV and so had to use a website host which offered a text editor along with their file manager. I now have a PC, but have continued to operate that way. I've kept all my files at various website hosts and "transloaded" the files between them.

Then recently I started using a new website host, Phenominet, for their low cost unlimited data transfer package for not-for-profit sites. They didn't offer a text editor, so I continued to edit at another site and learned how to FTP from the website host with the text editor to my PC and then to Phenominet.

So I now have a copy of everything on my PC.

Well, today the website host with the text editor upgraded their file manager and did away with the text editor. So now I need to learn how to edit on my PC.

I have two problems/questions:

1. When I attempt to edit the html files on my PC with Notepad (Is this the best editor to use?), it doesn't find them because it expects .txt files and they all end in .html.

2. With Internet Explorer I can access my pages right off my PC with c:\... but the pages don't find the graphics in the subdirectories. I reference them with, for example:

graphics/picture.gif

I have seen coding with:

/graphics/picture.gif

but have left the second / out because it never seemed to be needed. Is this the problem? (I can't try it easily until I resolve problem 1.)

Thanks, and feel free just to point me to a tutorial if you know of one.

Thank God for forums!

Lisa

8:30 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Peter (in WA?),
You should read some of the threads in the Text Editor Forum [webmasterworld.com]. There are may text editors better then notepad. Notepad will work in a pinch but some companies out there have spend thousands developing editors just for HTML.

My personal favorite is Homesite [macromedia.com]. But everyone around here has their own favorite.

The answer to your second question is:
If the URL is local reference not the full URL starting with http:/ then a slash in the beginning means the root of your domain name. So "/something" means domain.com/something, but "something.gif" means local directory. So if your page was at domain.com/faq/ then the URl for something.gif would be domain.com/faq/something.gif

dstanovic

8:32 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



1. When you open notepad, then go to open file dialog box choose "all files" from file type drop down list box.

2. give a absolute path to the graphic such as "http://www.mysite/graphics/pic1.gif"

tedster

8:34 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In Notepad, there's a drop-down menu at the bottom of the File > Open window that says "files of type". and it's set to "Text Documents". Just drop down the menu and choose "All Files (*.*) to see everything, including HTML files.

On your image problem - did you download the images into a subdirectory with the proper name on your local machine? Relative URLs should work locally IF the subdirectory and image files are in place.

[edited by: tedster at 8:35 pm (utc) on June 2, 2002]

Key_Master

8:55 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If all of your graphics are already downloaded to the server you can view them on your PC if you place the following code between the <head></head> tags in the HTML

<base href="http://www.yourdomain.com/">

peterinwa

9:00 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



Notepad is working fine now. Still can't get the graphics to display.

The page displays under:

C:\Websites\cph\index.html

The graphic is there and it is:

C:\Websites\cph\graphics\new_h21w32.gif

though my browser won't display it with the above URL. It seems to be trying to display it with Paint.

Does it matter that in my HTML I use / but my PC seems to be expecting \?

Thanks!

peterinwa

9:02 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



Key_Master...

Are you saying that I shouldn't be trying to display the graphics from my PC? That you can't?

That could certainly be my problem.

Marcia

9:02 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I went to right after Notepad - the free version, the only one then. It was a couple of years ago and didn't support images in a separate file then, but for the basic features I've never found one I like better. It is the easiest of all of them for a beginner, with a very intuitive interface.

Site-Aid:
[amiasoft.com...]

I don't believe in a lot of bells and whistles for a beginner, it's enough to pick up code without having to learn complicated software. imho the simpler the better until more is absolutely needed for frequent use.

You can just type the code, exactly like in Notepad, but there are user-friendly buttons to click to insert code which saves the wrists, very important if someone has Carpal Tunnel Syndrome or tendinitis from an injury like I did.

Lisa

9:04 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



C:\Websites\cph\index.html
C:\Websites\cph\graphics\new_h21w32.gif

For that location you will need to do this.
<img src=graphics/new_h21w32.gif>

Editing it locally is tricky, because when you move it to the web you may have different local references. I try to edit all my HTML locally, but review the changes after I upload them.

peterinwa

9:09 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



Lisa... that is exactly what I have so something else must be wrong.

Lisa

9:12 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could try

<img src="../graphics/new_h21w32.gif">

Also watch capitalization if you are uploading to a Unix machine.
Unix requires exact case, but windows doesn't care.

[edited by: Lisa at 9:13 pm (utc) on June 2, 2002]

peterinwa

9:50 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



../ still didn't work. To be clear... using Internet Explorer I can display my web pages from my PC but the graphics don't show.

I tried Key_Master's idea and it works. Putting <base href="http://www.yourdomain.com/"> in the <head> tags. Though I'd still like the graphics to display from my PC rather than a webhost site.

Good enough for now. Thanks everyone.

peterinwa

9:55 pm on Jun 2, 2002 (gmt 0)

10+ Year Member



Oops! Except that if you use Key_Master's idea putting <base href="http://www.yourdomain.com/"> in the <head> tags then your links take you out of your PC and to yourdomain.com.

Thought I'd better post that for future reference.

papabaer

11:30 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



peterinwa, after you have edited and saved your page in the actual site's root directory (cph?) you can view your images locally by just setting the relative path <img src="graphics/new_h21w32.gif"> as Lisa has already noted.

This is assuming that the page you are editing resides in the folder gph and the graphics folder is directly below it.

You must save the edit before you will be able to see the changes. Base url is a good idea, but not required for viewing locally. Try it and see if that works (it does for me!) ;)

[edited by: papabaer at 11:34 pm (utc) on June 2, 2002]

Purple Martin

4:50 am on Jun 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> ../ still didn't work

../ means go up one folder level from wherever the html file is.
./ means use the current folder where the html file is.

If you want to go up 2 levels you can use ../../ and similarly up 3 levels would be ../../../