Forum Moderators: open
On the main page, I have some anchor text w/ a link to another html document: chapter 2: Widgets.
No matter what I do, the chapter 2 document does not come up when you click that link. Chapter 2 is an html document in the same folder as the main page of the website.
I tried using a different document to link to. I went back to the source code instead of
<a href="chapter2.html">
I paste in:
<a href="chapter1.html">
and the link works fine (for chapter 1)
I tried changing the title of the document, instead of chapter2 I called it chaptertwo.html. Still no work.
I went to different click on sections of the main page and stuck in a link to chapter2. THese links will not open either. Although they are fine when they link to other html documents in the same folder.
What the heck is going on here? it is probably somethign stupid, I am new to this...
Are you sure your file was saved as "chapter1.html" - it could perhaps of been saved as "chapter1.htm" and thus would not show up. Id's recommend opening up the HTML file (chapter1.html) in a text editor (notepad) and saving it as "chapter1.html" and then uploading this to the same folder your main site is on.
It should be working :)
I did try right clicking and trying to open it. Still no go. I am not sure about the other suggestion, to try right clicking and checking the path. I was looking at the path name as it came up, didnt think to double check it.
I finally got the thing to work in the most clumsy workaround imaginable. I copied the entire code into another html doc that was working. So the only thing different was the title. That worked. Then I changed the title back to what I wanted, so it works now.
Very strange. Still scratching my head.
THey both look the same except that for the one that opens, at the bottom of the properties box it says "unblock" and "files were sent from another computer and security reasons.."
Doesnt seem to be the problem, I hit the unblock box and the file continues to open correctly.
Could it be the use of a numeral e.g. "3" in the title? I am stumped.
"Have you tried right clicking on the link text i.e. <a href="chapter1.html">Chapter 1</a> in the browser and checking the full address (URL) path copying it and pasting it into the browser address bar."
you mean when I am in the main page (i.e. the page that has link text). I can right click on the link text and there is a command called "copy short cut". So I copied it and pasted it into the source code. STill no go.
Is that what you mean? Because otherwise I cant just copy the URL from the window because the URL only remains there as long as the cursor is over that link, when I move the cursor the URL disappears..
I'm also wondering about your link syntax - do they all look like this:
<a href="page.html">LINK TEXT HERE</a>
One of the quotes may be missing, for instance. Or perhaps the </a> to close the anchor tag. At any rate, I strongly sugggest you validate the html page at the W3C.
W3C Validator - HTML [validator.w3.org]
<a href="chapter1.html">Chapter 1</a>
Something which can sometimes be overlooked unless you pay extra attention - be sure you are keeping the file name reference inside the quotes in the same case (UPPER/lower) as that in which the file was saved.
"Chapter1.html" is NOT the same as "chapter1.html".
It all cleared up once I made sure the file names and extensions
were consistently spelled with regard to CASE. -Larry
"No DOCTYPE Found! Falling Back to HTML 4.01 TransitionalA DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate this document. I am falling back to "HTML 4.01 Transitional" and will attempt to validate the document anyway, but this is very likely to produce spurious error messages for most non-trivial documents."
Now what do I do next?
Note: if you add a complete doctype, modern browsers will swtich into "standards mode" for rendering your page. Without a complete doctype you are seeing quirks mode rendering. So adding a full DTD may break your layout in unexpected ways.
With this in mind, for now, I'd suggest using a partial doctype as the first element of your HTML document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
If you want to get into the whole area of quirks and standards (you will eventually) use the complete DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
And when you are ready, you can start learning about the whole thing by reading this thread:
Quirks Mode and Standards Mode [webmasterworld.com]
As a final reference, here is the W3C list of valid DTDs:
[w3.org...]
***
Okay I went back to my source code and added the DTD statement. THere are lots of errors or whatever, over 100.
Should I go back and attempt to fix all this? WHy? I started my web page by plagiarizing it from a web page with layout that I liked. This web page has not DTD in it.
I took that web page and stuck it into the W3C validator and it produced a bunch of errors or whatever. But despite this, their page is working fine for most/all browsers.
Are you telling me, now I have go fix all these errors? Why? The page I borrowed it from is working fine with all these errors/whatever.
I got it to work by actually importing the source code into a doc.
What software are you using, all together? A .doc is not a good place to be working with html source code - word processing automatically adds too many things which you could easily miss, like smart quotes, for instance.
For working directly with HTML or CSS source code, you want a plain text editor or an HTML editor, not a word processing application.
Also, if all you care about is that the page looks right in the browser you are using (Internet Explorer, I assume, either 5.5 or 6) then you can ignore the errors and just test your page by eye. However, this approach can give some really dicey results on other browsers and user agents. Don't forget that a search engine spider is a kind of user agent! You probably care that tghe search engines see all your content, exactly as you intended it.
There is a reason for the standards - and although it is a bit of learning curve, I do recommend that everyone begin to get a handle on how to write valid HTML. Explorer has elaborate error recovery routines built in and apparently your errors are not "too much" for it to handle - or you may even be depending on those routines for getting the look you want. But with standards-compliant mark-up you are not counting on any particular browser's internal error recovery.
Who knows if the next version of Explorer (7.0 later this year) will handle non-standard code in exactly the same way.
So know that there must be an error in the mark-up, or a typo in the file name, or perhaps the file is not in the directory that the path points to. Something is wrong there, and you just need to track it down.