Forum Moderators: open

Message Too Old, No Replies

"type" not specified in Style tag

Trying to validate javascript

         

Lorel

10:06 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,

The wc3 validator says that the script that I'm using (I don't write JS) produces an error:

tag <style> missing required attribue "type".

I understand it needs an attriube similar to an alt tag but I'm not sure what to put in there.

Can I just put something in there to describe what the JS is for, i.e., falling snowflakes?

thanks
Lori

claus

10:28 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you think about external javascript:

<script type="text/javascript" src="sourcefile.js">

... or do you think about the inline style tag:

<style type="text/css">

... or possibly the external stylesheet tag:

<link rel="stylesheet" type="text/css" media="screen" href="stylesheet.css">

IMHO, one of these three will be the right one for you.

Purple Martin

10:30 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The style tag is for CSS styles. I think you're confusing it with the script tag!

You need to add the following attribute to the style tag to tell the browser that it contains CSS:

<style type="text/css">
/* css stuff here */
</style>

Similarly, any script tags containg JavaScript should look like this:

<script type="text/javascript">
// js stuff here
</script>

Don't use the language attribute in script tags any more, it's discontinued (for the doctype I suspect you're using).

Lorel

1:53 am on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Here is the style tag. It is outside of the script tag thusly:

<style>
.drop { position: absolute; width: 3; filter: flipV(), flipH(); font-size: 30; color: blue }
</style>
<script type="text/javascript" language="javascript">

--blah blah blah--

</script>

Lorel

1:57 am on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Purple Martin,

I didn't read your suggestion till after I posted my reply. Your suggestion worked. Thanks
Lori