Version complète: sur le forum Webmaster Hub : Pb valication w3c
Webmaster Hub > Création et exploitation de Sites Internet > Les langages du Net > (X)HTML et CSS
mandala75
Bonjour,

Je viens de faire une recherche rapide mais je n'ai pas trouvé réponse à mon pb.
J'essaie de valider une page w3c mais on m'indique que

CODE
there is no attribute "LEFTMARGIN"

<BODY bgColor="#f7f7f7" leftMargin="0" topMargin="0" marginheight="0" marginwidt

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.


Comment remplacer les attributs marginwidth, marginheight etc.

Merci d'avance
lupucide
Il faut passer par une feuille de style.

CODE
body {
margin: 0;
}


Entre <head> et </head>. Je te conseil ce site pour débuter : Le site du zér0.
Vincent
tu peux mettre ces elements dans une feuille de style.

exemple : http://fr.selfhtml.org/css/proprietes/marge.htm

cela pourrais ressembler a ceci :
CODE
<head>
<style>
body {
font-family: verdana, arial, sans-serif;
margin-right: 10px;
margin-top: 3px;
}
</style>
</head>
Dudu
CODE
<BODY bgColor="#f7f7f7" leftMargin="0" topMargin="0" marginheight="0" marginwidt
Cette ligne, tu peux la remplacer de la manière suivante:



HTML
<body>

et tu mets juste avant la balise </head> ceci:
CODE
<style type="text/css" media="all">
/* <![CDATA[ */
body { margin: 0; padding: 0; background-color: #f7f7f7; }
/* ]]> */
</style>


Tu obtiendras ainsi le même effet visuel, et ta page passera le validateur smile.gif
mandala75
Merci à tous, bonne journée.
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'information, la mise en page et les images, veuillez cliquer ici.