View Full Version : javascript and css

12-24-2003, 01:23 PM
Hi everyone, I am a beginner with css, and have been doing well with learning this. I decided to place a card online for christmas for my family and friends.

I also wanted a snow script, which I have on the page.

My question is that I use the xhtml transitional doctype, and when using the script it doesn't work. I have to go back to the html doctype.

Also I would have liked to have linked this to the page as well as my css for the page but this would not work either.

I'm not familar with javascript, so any help would be appreciated as far as guidance for a really easy tutorial for inserting scripts and also for making them css compliant, if that is actually the term that I am looking for.

Here is the link for the page
Some people are informing me that on their browsers t he page is going goofy. However, on my pc I tested on NN7, Mozilla, Opera, and IE6, all recent browsers and didn't have a problem.

Thanks in advance, and I believe this is my first posting here in this forum, though have been a lurker for a long time.

12-24-2003, 07:00 PM
Not too bad for a newcomer. :p Although in Mozilla (Firebird, Netscape 7, etc) the positioning is a bit off. You can't read part of it. Shouldn't be too hard to fix though.

But I have to say that this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

... is not a valid DOCTYPE for HTML 4.01. However, this is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

Although this XHTML one should be better if you wanted to go that route.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Now, I know you said that it wasn't working for some reason with the XHTML DOCTYPE. However, I can't see it, so I wouldn't know what's wrong and how to fix it. Could you post a page using the proper XHTML DOCTYPE so I could take a look?

12-24-2003, 08:28 PM
Not too bad for a newcomer

:o Thanks, I have actually been working at teaching myself for about a year or more now. Long hard road to travel, lol.

Thanks for your answer so quickly! I didn't think that I would hear anything until maybe friday!

I'll do a page on friday with the xhtml version and put it up on the site.

For some reason the snow script won't work with the xhtml. I'm not sure if there is a stricter script that is xhtml compliant?

Thanks again!

btw, Merry Christmas

12-25-2003, 06:07 PM
I fixed the doctype, however the following are the errors that I am recieving.

Below are the results of attempting to parse this document with an SGML parser.

Line 6, column 22: document type does not allow element "STYLE" here (explain...).
<style type="text/css">
Line 76, column 6: end tag for element "HEAD" which is not open (explain...).
Line 78, column 5: document type does not allow element "BODY" here (explain...).
Line 79, column 32: required attribute "TYPE" not specified (explain...).
<script language="JavaScript1.2">
Line 210, column 17: document type does not allow element "P" here (explain...).
<p align="center">

Line 210 is out of my control :mad: as this is placed in here by my host. I unfortunatly am not able to do anything about this.

If I'm using an embedded style sheet, why does this show up as not being valid? Is this not usable in html? Or is this placed wrong?

Thanks in advance