Help Center
Help Links | FTP Manual  
 

HTML FAQ



Table of Contents

  1. What is HTML?
  2. How can I create HTML files?
  3. Is there another way to create HTML files?
  4. What is the index.html file and why do I need this file?
  5. What is the HTML code for placing images on my pages?
  6. Do I always have to use the WIDTH and HEIGHT attribute inside the tag?
  7. Why does my image not appear?
  8. How can I make a link using an image?
  9. When do I have to put an attribute's data in quotes, or can I leave the quotes out all the time?
  10. Okay, I have different directories, but I don't know how to link to files or images within these other directories.
  11. What means "File names have to be case sensitive"?
  12. How can I put music on my site, that starts to play immediately when someone visits my site?
  13. Okay, but how can I put music on my site, that starts to play when someone clicks on a button or on a link?
  14. How can I add JavaScripts to my page?
  15. Is it okay, to create HTML files that only work well with Netscape or Internet Explorer, so that only users of one of these browsers can view my pages?


1. What is HTML?

HTML stands for HyperText Markup Language. All web pages are written in this simple programming language. To say it in an easy way: HTML describes the content of a web page, what text there will be displayed, what images, what sound and so on. Images and sounds are not part of a HTML file, but the HTML file "refers" to other files like images or sounds.

Table of Contents

2. How can I create HTML files?

To create your own HTML files you only need a text editor like Notepad or SimpleText. You can write the plain HTML code up and save the file with the ending .html.

Table of Contents

3. Is there another way to create HTML files?

Yes, you can use so-called "WYSIWYG" editors. These are easy-to-use programs just for creating web pages. And they'll let you see your page while you're creating it (WYSIWYG stands for "What you see is what you get"). WYSIWYG editors can do a lot of work for you if you don't know HTML. They are as easy to handle as text editors or other applications. But the real "hardcore" webmaster writes all his files in pure HTML. WYSIWYG editors don't let you have much control over your HTML files. Yahoo! PageBuilder is also a WYSIWYG editor.

Table of Contents

4. What is the index.html file and why do I need this file?

Your homepage address at Yahoo! GeoCities is a chain of directories and sub-directories. An example: Your homepage address is http://www.oocities.org/TelevisionCity/1010. When a visitor enters your address into his browser's address field and presses enter, the browser searches for an internet server called www.oocities.org. When he is connected to the server he searches for the directory called TelevisionCity and then for the sub-directory called 1010 within that directory. And at this point the index.html file is important.

Providers of internet servers can specify which file a browser should load when entering a directory. In that case, when the visitor has entered the sub-directory 1010, the browser "asks" the server www.oocities.org: "There are several files in this directory. Which one should I open?" And as GeoCities has set it's standard homepage filename to index.html, the server responds: "Open the file called index.html".

So, do you understand why the first page of your site has to be named index.html? If there is no index.html file in your directory, the browser can't open it. And it will not search for another file, as the server said "There has to be a file called index.html".

Just keep in mind that the front page of your site has to be named index.html and everything will work fine. If you ever remove your index.html file from your directory, be sure to replace it by a new one with the same name.

Table of Contents

5. What is the HTML code for placing images on my pages?

To put an image on your pages use a code like this: Alternate Text. Instead of filename.gif write the name of your image file between the quotes. File names are case sensitive which means that if your file is named picture.jpeg, you can't write picture.JPEG, you have to write picture.jpeg, the exact file name. For WIDTH and HEIGHT use the width and height of your image in pixels and for ALT enter an alternate text like a short description or title of the image.

Table of Contents

6. Do I always have to use the WIDTH and HEIGHT attribute inside the tag?

Well, it will also work fine without WIDTH and HEIGHT, but I suggest to use them. First of all, pages are loaded really faster, when you specify the width and height of images inside the tag. And secondly, when loading the page, web browsers will exactly know where they have to leave space until the image is loaded. Also, you should use the ALT attribute inside the tag.

Table of Contents

7. Why does my image not appear?

There can be several reasons why an image doesn't appear. When this happens, it's the best to first check the HTML code. People often just forget a quote (") after the file name or a closing bracket (>). But more often they forget that file names have to be case sensitive. If you wrote but saved the file as Picture.gif, it won't appear, as picture.gif and Picture.gif are two different names (for web servers and browsers). Be always sure two write file names exactly as they have been saved. This rule applies to ALL kinds of files, not only image files, also HTML files, audio files and even directories.

Another thing to take care of is using the right transfering method when uploading your files by FTP. There are two methods: Text and Binary. Every FTP client lets you choose what tranfering method you want to use. For HTML files, always use Text, for images (JPEG, GIF or whatever) and all other files, always use Binary. If you don't use Binary mode, the image file will be corrupted during the upload and then it will not be displayed on your web page.

Table of Contents

8. How can I make a link using an image?

If you know how to create links, you won't have any problems with it. Instead of placing some text between and , just put the code for images in there, so the link will look like .

You might ask, what BORDER=0 means. Normally, when using an image as link, web browsers will automatically create a little border around it which is usually 2 pixels thick. With BORDER=0 that border won't appear (and this looks really nicer!).

Table of Contents

9. When do I have to put an attribute's data in quotes, or can I leave the quotes out all the time?

The current HTML standard allows you to leave quotes out when the attribute's data consists only of alphanumeric characters. Alphanumeric characters are all letters from A-Z and a-z and all numbers from 0-9. For example: When you specify the width of a horizontal rule, you can write WIDTH=400 if you want to specify the width in pixels. But when you want to specify the width in percent, then you have to write WIDTH="75%".

* Note: My experience has shown me that it makes absoloutley no difference, if you put an attribute's data in quotes or not, even when it contains a non-alphanumeric character. To make your HTML files smaller, it's the best to leave as much quotes as possible out. But it's absoloutely necessary to put the data of SRC, HREF and NAME in quotes.

Table of Contents

10. Okay, I have different directories, but I don't know how to link to files or images within these other directories.

Well, to link to files in other directories it's the best to always use relative path names. Let's explain it by an example: Your homepage address is http://www.oocities.org/TelevisionCity/1234. In your directory, you have some files and three other directories called main, info and gallery. Your homepage directory is the parent directory of your site as it contains all the other directories and files of your site.

Let's say you want to link from your front page (index.html), to a file called personalinfo.html which is located within the directory called info. In that case your link would look like . If you want to link to a file within another directory, just write the name of the directory and then after the slash the name of the file.

Always remember that those other directories have to be in the same directory as the file that contains the link. In other words: You can't link to a info/personalinfo.html if the link is on a file that is located within the directories info, main or gallery.

Another example: Let's say you want to link from the page personalinfo.html (within the directory info) to the page gallery1.html which is located within the directory gallery. You first have to "go" back to your parent directory. You do this by beginning the link with ../. And then just link to gallery/gallery1.html, the complete link would look like . So, to link from a deeper directory back to a higher directory, place ../ in the link.

To link back from info/personalinfo.html to 1234/index.html, just write . You can always link through as much directories as you want, so links like or are certainly possible.

Table of Contents

11. What means "File names have to be case sensitive"?

It's a simple but important rule for website builders. When you save a file to your hard disk, let's say as something.html and want to save another file as Something.html, it will not work. For your computer these two names are the same. The only difference is that something.html is written with a small s and Something.html is written with a capital S. But they have the same name, right?

Wrong! Your computer doesn't care about big or small letters. Letter is letter, name is name. But for some reason internet servers (those computers who are used to provide websites) are very strict with letters and file names. S is S and s is s for them and not the same. And when you try to save two files on an internet server, one as something.html and one as Something.html, it will work, as these are two different file names for the server.

And so you might understand why filenames have to be case sensitive. When you have a page called something.html and want to link to that page, you have to write . If you write , the link won't work, as Something.html is another file for the server as something.html.

This rule applies also to directories and to all kinds of files: HTML files, JPEGs, GIFs, WAVs, MIDI files, RealAudio files, RealVideo files, ZIP files and so on. And remember that the file ending is also part of the file name! .html is not the same as .HTML or .Html or .htm.

Table of Contents

12. How can I put music on my site, that starts to play immediately when someone visits my site?

There are two methods, but the following should work best with both Internet Explorer and Netscape 4.0 or higher. Between the and tags of your HTML file, insert , where anyfile.mid is the name of the music file you wish to use as background music. You can also refer to a file from another directory. LOOP=INFINITE means that the music plays endless, but you can also insert a number instead of INFINITE, then the music will be repeated as often as you want. You can use Midi-Files and WAV-Files for background music.

Netscape used to know this method for playing background music: . But it seems as if this doesn't work with newer versions of Netscape anymore. So you should use the first method mentioned.

Table of Contents

13. Okay, but how can I put music on my site, that starts to play when someone clicks on a button or on a link?

Well, there are two ways. You can create simple links to your WAV or Midi files. When someone clicks on such a link, the browser will automatically launch an application which can play that sound. This works only, when the visitor has an application chosen for playing sounds. There is a section in the preferences of both Netscape and Internet Explorer where users can select applications as "helpers" for file types that the browser doesn't support. When your visitors click on a link which refers to a WAV or Midi file, the browser will download that file and then open an application to play it, if he knows what application to open. In most cases this works.

The other way would be to use the tag. In that case the browser can play that sound if he has a plug-in installed which enables him to play Midi or WAV files. There will be something like a control panel displayed and when the visitor clicks on the play button, the sound file will be played either by the plug-in itself or by an application the plug-in belongs to. This will be different depending on what plug-ins the visitor has installed.

The HTML code should look like . You can also place a link between these two tags: <A HREF="anyfile.wav">Click here to play the sound</A>. When someone visits your page using an older browser or has no plug-in installed, he will only see that link and can click on it to download and play the sound.

Table of Contents

14. How can I add JavaScripts to my page?

JavaScripts are little scripts you can use for bringing more life into you web pages (like rollover effects, background music, changing background color etc.). To add such a script to your page, just use the tag at the end. It maybe different from script to script where to include it (some have to be in the head, some have to be in the body).

There are also some other functions of JavaScript where you only have to insert a little code within other HTML tags. But if you are experienced enough to know how to write JavaScripts you will also know how it works to include them on your page. Everyone other should check sites like Website Abstraction, The JavaScript Source or Javagoodies to find pre-written JavaScripts for free together with instructions on how to use and include them on your page.

Table of Contents

15. Is it okay, to create HTML files that only work well with Netscape or Internet Explorer, so that only users of one of these browsers can view my pages?

Some browsers offer really interesting features for HTML writers. While Netscape has some additional HTML tags implemented, Internet Explorer offers some specific JavaScript possibilities. But it seems to me, that Netscape is still and will always be a trendsetter when it's about HTML extensions. Many formerly Netscape specific tags are part of today's HTML standard, for example Frames. Anyway, you should not write pages that can be only seen by user's of a specific browser. Sure, you can put some special features into your web pages especially for Netscape or Internet Explorer users, but you should make sure, that this doesn't produce a complete chaos on the screen of other browser's users.

Table of Contents



http://geocities.yahoo.com/tvcitycom
TelevisionCity Central is a collaborative project of the TelevisionCity Community Leaders.
If you have any comments or suggestions, please use our contact page to send us a message. Go!
Design and HTML coding by Webstorm. Site maintained by Crimemonkey.
Copyright 2000 - All Rights Reserved