Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [xhtml] dziwny blad walidatora
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
Caw
Witam napisałem strone jako XHTML 1.0 Strict poprawiłem już wszytskei błedy i został mi jeden następującej treści:

Cytat
Line 17, Column 29: there is no attribute "name".

<img src="zd/start.jpg" name="rov1" alt="index" width="60px" height="16px" /><…

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.



Menu na mojej stronie zrobiłem jako ROOLOVER za pomocą takiego sposobu:

<div id="menu">

<a href="index.html" onmouseover="rov1.src='zd/start_vis.jpg'" onmouseout="rov1.src='zd/start.jpg'">
<img src="zd/start.jpg" name="rov1" alt="index" width="60px" height="16px" /></a>

<a href="portfolio.html" onmouseover="rov2.src='zd/portfolio_vis.jpg'" onmouseout="rov2.src='zd/portfolio.jpg'">
<img src="zd/portfolio.jpg" name="rov2" alt="portfolio" width="97px" height="16px" /></a>

<a href="about.html" onmouseover="rov3.src='zd/about_vis.jpg'" onmouseout="rov3.src='zd/about.jpg'">
<img src="zd/about.jpg" name="rov3" alt="portfolio" width="73px" height="16px" /></a>

<a href="kontakt.html" onmouseover="rov4.src='zd/kontakt_vis.jpg'" onmouseout="rov4.src='zd/kontakt.jpg'">
<img src="zd/kontakt.jpg" name="rov4" alt="kontakt" width="96px" height="16px" /></a>

<a href="greatest.html" onmouseover="rov5.src='zd/greatest_vis.jpg'" onmouseout="rov5.src='zd/greatest.jpg'">
<img src="zd/greatest.jpg" name="rov5" alt="greatest" width="100px" height="16px" /></a>

<a href="skills.html" onmouseover="rov6.src='zd/skills_vis.jpg'" onmouseout="rov6.src='zd/skills.jpg'">
<img src="zd/skills.jpg" name="rov6" alt="greatest" width="71px" height="16px" /></a>

</div> <!-- menu -->


Czy jest to niepoprawny i zabroniony w XHTML sposób? czy chodzi o atrybut NAME? i dlaczego pokazuje tylko w jednym miejscu a nie zakreśliło mi wszystkich. Walidator wywala mi tylko jeden błąd tam gdzie jest name="rov1" atrybut ten musi być bo bez niego nie działa.
maciejkiner
Witam

Zamiast name="abc" mozesz dac id="abc" i odwolywac sie przez:

  1. document.getElementById("abc").src=""


pzdr
maciejkiner
Caw
samo id wystarczyło własnie sam wpadłem ze NAME nie wolno "This Page Is Valid XHTML 1.0 Strict!" winksmiley.jpg



TEMAT DO KASACJI
misiek08
Błąd mówi, że twój typ dokumentu nie obsługuje atrybutu name dla znacznika img czyli tak jak @up napisał zamien na np id lub pomiń jeżeli nie musisz się do niego odwoływać
koderrr
jesli zalezy ci na walidacji
i ogolnej jakosci kodu

to nie wiem dlaczego to menu nie jest oparte o liste
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.