The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Embed Music- Validator Error
queenbee123
post Mar 10 2011, 03:13 AM
Post #1





Group: Members
Posts: 3
Joined: 10-March 11
Member No.: 14,092



Hi

I want to embed a hidden music player on a webpage. When I open the webpage the music plays.

However, when I run my code through the validator i get 5 errors with the embed music part.

I put this code in the <head> section: right after </style> and before </head>

here is the code i used:
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>

Please help me to change the code the validator check out without errors.
Thank you!


This is what the validator says re that:

Line 22, Column 12: there is no attribute "SRC" <embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 22, Column 34: there is no attribute "AUTOSTART" <embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 22, Column 46: there is no attribute "LOOP" <embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 22, Column 60: there is no attribute "HIDDEN"
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 22, Column 66: element "EMBED" undefined <embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:

•incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
•by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
•by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 10 2011, 03:41 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,270
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



HTML 5 is the first public spec to include the embed element. If you aren't validating against HTML 5, then the embed element won't validate.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
queenbee123
post Mar 10 2011, 03:52 AM
Post #3





Group: Members
Posts: 3
Joined: 10-March 11
Member No.: 14,092



QUOTE(Darin McGrew @ Mar 10 2011, 03:41 AM) *

HTML 5 is the first public spec to include the embed element. If you aren't validating against HTML 5, then the embed element won't validate.


Hi Thank you!

so how would the top change? it is currently:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

how to do i make it HTML5?

thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 10 2011, 07:09 AM
Post #4


.
********

Group: WDG Moderators
Posts: 7,837
Joined: 10-August 06
Member No.: 7



For HTML5 you can use the following Doctype:

CODE
<!doctype html>


but I don't think the validator here http://htmlhelp.com/tools/validator/ supports HTML5 yet.

The W3C validator at http://validator.w3.org/ seems to support HTML5, though.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Mar 10 2011, 10:19 AM
Post #5


This is My Life
*******

Group: Members
Posts: 1,125
Joined: 24-August 06
From: t-dot
Member No.: 16



There's also this validator http://html5.validator.nu/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
queenbee123
post Mar 10 2011, 07:30 PM
Post #6





Group: Members
Posts: 3
Joined: 10-March 11
Member No.: 14,092



QUOTE(Christian J @ Mar 10 2011, 07:09 AM) *

For HTML5 you can use the following Doctype:

CODE
<!doctype html>


but I don't think the validator here http://htmlhelp.com/tools/validator/ supports HTML5 yet.

The W3C validator at http://validator.w3.org/ seems to support HTML5, though.


thank you. i changed the doctype however that code seems to still give errors:

Line 21, Column 66: Bad value true for attribute hidden on element embed.
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉

Line 21, Column 74: Stray end tag embed.
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>✉

Line 22, Column 7: Stray end tag head.
</head>✉

Line 24, Column 6: body start tag found but the body element is already open.
<body>✉

Line 25, Column 81: Bad value 100% for attribute width on element img: Expected a digit but saw % instead.
…page-background"><img src="back2.jpg" width="100%" height="100%" alt=""></div> Syntax of non-negative integer:
One or more digits (0–9). For example: 42 and 0 are valid, but -273 is not.

Line 25, Column 81: Bad value 100% for attribute height on element img: Expected a digit but saw % instead.
…page-background"><img src="back2.jpg" width="100%" height="100%" alt=""></div> Syntax of non-negative integer:
One or more digits (0–9). For example: 42 and 0 are valid, but -273 is not.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Mar 10 2011, 07:55 PM
Post #7


WDG Member
********

Group: Root Admin
Posts: 8,270
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(queenbee123 @ Mar 10 2011, 04:30 PM) *
Line 21, Column 66: Bad value true for attribute hidden on element embed.
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>
The hidden attribute isn't part of the standard.

QUOTE(queenbee123 @ Mar 10 2011, 04:30 PM) *
Line 21, Column 74: Stray end tag embed.
<embed src="boats.mp3" autostart="true" loop="true" hidden="true"></embed>
You don't need the closing </embed> tag (the same way you don't need a closing </img> tag for images).

QUOTE(queenbee123 @ Mar 10 2011, 04:30 PM) *
Line 22, Column 7: Stray end tag head.
</head>

Line 24, Column 6: body start tag found but the body element is already open.
<body>
You have stray tags that don't belong there. Just remove them.

QUOTE(queenbee123 @ Mar 10 2011, 04:30 PM) *
Line 25, Column 81: Bad value 100% for attribute width on element img: Expected a digit but saw % instead.
…page-background"><img src="back2.jpg" width="100%" height="100%" alt=""></div> Syntax of non-negative integer:
One or more digits (0–9). For example: 42 and 0 are valid, but -273 is not.

Line 25, Column 81: Bad value 100% for attribute height on element img: Expected a digit but saw % instead.
…page-background"><img src="back2.jpg" width="100%" height="100%" alt=""></div> Syntax of non-negative integer:
One or more digits (0–9). For example: 42 and 0 are valid, but -273 is not.
Use the actual dimensions of the image for the height and width attributes. Don't use percentages, and don't use the attributes to get the browser to resize images.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th June 2018 - 04:23 PM