Probleme Validateur XHTML Balise Audio

Résolu/Fermé
Tibz21 Messages postés 2 Date d'inscription lundi 7 décembre 2015 Statut Membre Dernière intervention 8 décembre 2015 - 7 déc. 2015 à 22:14
Tibz21 Messages postés 2 Date d'inscription lundi 7 décembre 2015 Statut Membre Dernière intervention 8 décembre 2015 - 8 déc. 2015 à 19:07
Bonjour j'ai un Problème avec le validateur XHTML, il ne reconnait pas la balise audio et tout les éléments qu'elle contient, voici mon code html:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>

<title>index</title>


<link rel="stylesheet" type="text/css" href="../style/extrait.css" />
</head>
<body>
<div>

<h1>
Musique
<br />
<br />
<br />
<audio controls>
<source src="../media/extrait1.mp3"></source>
</audio>
</h1>

</div>

</body>
</html>

Pour le Css:


body {
padding: 30px 0;
color: #F0E39E; /* couleur du body ou truc entete */
background-image:url(../media/extrait.jpeg);
}
div{
text-align: center;

width: 500;
height: 500;
margin : 150px auto auto auto;
}


Je précise que tout marche correctement, j'arrive à lancer la musique depuis le lecteur etc, seul le validateur a un problème, mais j'ai pour obligation de n'avoir aucune erreur au validateur XHTML..

Voici les messages d'erreurs donnés par le validateur:


Validation Output: 4 Errors

X is not a member of a group specified for any attribute



Line 25, column 16: "controls" is not a member of a group specified for any attribute

<audio controls>




Error there is no attribute X


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 26, column 14: there is no attribute "src"

<source src="../media/extrait1.mp3"></source>




Error element X undefined



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).

Line 25, column 16: element "audio" undefined

<audio controls>

Line 26, column 37: element "source" undefined

<source src="../media/extrait1.mp3"></source>




Merci de m'aider a résoudre mon problème, si vous pourriez me donner une correction de mon code je vous en serais très reconnaissant. :)
A voir également:

1 réponse

Nhay Messages postés 838 Date d'inscription vendredi 2 novembre 2012 Statut Membre Dernière intervention 17 décembre 2015 126
8 déc. 2015 à 13:07
Bonjour,
Il me semble que ce sont des balises html5.
Donc ton validateur xhtml ne les connait tout simplement pas.
Deux solutions :
- Valider ton document en html5
- Ignorer le validateur
1
Tibz21 Messages postés 2 Date d'inscription lundi 7 décembre 2015 Statut Membre Dernière intervention 8 décembre 2015
8 déc. 2015 à 19:07
Merci!
0