PDA

View Full Version : [HTML]Problemi a validare questo codice


D4rkAng3l
28-02-2008, 20:29
Ciao,
ho qualche problema a validare questo codice (X)HTML presso il W3C, potete darmi una mano...il problema si crea perchè nell'ultimo div tento di mettere un javascript per la gestione delle statistiche del sito. Come posso inserirlo facendo in modo che il codice risulti cmq valido?


<!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="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="VacanzeSciacca.it: Prenota la tua vacanza in uno dei posti più belli della Sicilia, un luogo tra storia, cultura e natura" />
<meta name="keywords" content="vacanze sciacca, sciacca terme, affitti sciacca, mare sciacca, vacanza sicilia,stabilimento termale, case al mare, casa vacanza, affitto villa" />
<meta name="author" content="Andrea Nobili http://www.siatec.net/andrea/fotografia/" />
<link rel="stylesheet" type="text/css" href="default.css" media="screen" title="Esempio Sito Case Vacanze" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<!--[if IE]><link rel="stylesheet" href="ie.css" type="text/css" /><![endif]-->
<title>Esempio Sito Case Vacanze</title>
</head>

<body><div id="wrap">

<div id="header"></div>

<div id="avmenu">
<h2 class="hide">Menu:</h2>
<ul>
<li><a title="Home Page" href="#">Home</a></li>
<li><a title="I nostri trilocali in affitto" href="trilocali.html">I nostri Trilocali</a></li>
<li><a title="La nostra villetta in affitto" href="villetta.html">Affitto Villetta</a></li>
<li><a title="I luoghi e la natura" href="natura.html">I luoghi e la natura</a></li>
<li><a title="Sciacca Terme: storia e tradizioni" href="sciaccaterme.html">Sciacca Terme</a></li>
<li><a title="Dove siamo,un aiuto su come raggiungerci" href="dovesiamo.html">Come Raggiungerci</a></li>
<li><a title="Pagina dei contatti" href="contact.html">Contatti</a></li>
</ul>

<div class="announce">
<p><span class="bold">Città:</span> Sciacca Terme</p>
<p><span class="bold">Stato:</span> Italia</p>
<p><span class="bold">Regione:</span> Sicilia</p>
<p><span class="bold">Nome abitanti:</span> Saccensi</p>
<p><span class="bold">Santo patrono:</span> Maria SS. del Soccorso</p>
<p><span class="bold">Giorno festivo:</span> 2 Febbraio</p>
<p><span class="bold">Prodotti tipici:</span> Olio, Vino, Prodotti ittici conservieri, Ceramica artistica</p>
</div>

<div class="announce">
<h3>Ultime Notizie:</h3>
<p><strong>Gennaio 15, 2007:</strong><br />
NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS NEWS.</p>
<p class="textright"><a title="Pagina delle news" href="news.html">Leggi il resto...</a></p>
</div>

</div>

<div id="extras">
<h3>Altre info:</h3>
<p>Potete contattarci telefonicamente ai seguenti numeri:<br /> Tel: 0925/85753
<br />Cell:348/8922351</p>

<h3>Links utili:</h3>
<span>- <a title="Informazioni su Sciacca" href="http://it.wikipedia.org/wiki/Sciacca">Wiki Sciacca</a></span><br />
<span>- <a title="Ristoranti a Sciacca" href="http://ristoranti.saperviaggiare.it/sciacca-ristoranti.html">Ristoranti</a></span><br />
<span>- <a title="Discoteche a Sciacca" href="http://www.yeaah.com/disco/DiscoDetails.asp?IDDisco=357">Discoteche</a></span><br />
<span>- <a title="Diving Center a Sciacca" href="http://diving-centers.saperviaggiare.it/sciacca-diving-centers.html">Diving Center</a></span><br /><br />


<p>
<a title="Codice validato al W3C" href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10-blue"
alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
</p>

</div>

<div id="content">
<h2 class="testo">Benvenuto in Appartamenti a Sciacca:</h2>
<div class="testo">Per un'indimenticabile vacanza all'insegna dei colori e dei sapori del Mar Mediterraneo, Vi offriamo la possibilità di soggiornare in una delle più belle località siciliane. Sciacca offre al turista un connubio unico di natura selvaggia ed incontaminata, storia, arte, cultura ed una pregevole tradizione enogastronomica per gustare a pieno i sapori di questa terra dove troverete un mare azzurro, limpido, circondato da una natura a tratti ancora incontaminata. Mettiamo a disposizione tre esclusive villette completamente arredate e dotate di tutti i comfort per un piacevole soggiorno. <div class="bold">Mettiamo a disposizione due esclusive villette di 80 MQ (più veranda e giardino) di cui una è divisa in due trilocali di 40 MQ l'uno. Le ville sono completamente arredate e dotate di tutti i comfort per un piacevole soggiorno.</div></div>

<img id="immagine1" src="img/ico/naturaico.jpg" height="115" width="153" class="left" alt="icona" />
<h3>Natura:</h3><p>Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<p>"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>

<h3>Sciacca e la sua storia:</h3><p>Le origini di Sciacca sono antichissime, probabilmente al tempo dei Sicani o dei Fenici. Nel VII a. C., secondo Tucidide, gli abitanti di Selinunte avevano costruito, come confine del loro territorio, un castello che prese il nome di Terme Selinuntine <img id="immagine2" src="img/ico/cityico.jpg" class="right" height="115" width="153" alt="icona" /></p>

<p>Oggi è una citta di mare, turistica e termale. Ricca di monumenti e chiese, è nota fra l'altro per il suo storico carnevale.
La cittadina di Sciacca si trova sulla costa del Canale di Sicilia tra le foci del fiume Platani e Belice, a circa 65 metri sul livello del mare: ad est s’innalza il Monte San Calogero alto 386 metri, alle cui falde scaturiscono, per un percorso di circa sei chilometri, le famose acque termali.
È situata a forma di anfiteatro sul mare a mezzogiorno della Sicilia, di fronte all'isola di Pantelleria e Tunisi, a metà strada tra le rovine di Selinunte, Eraclea Minoa, ed Agrigento.</p>
<p>Sciacca conserva molte opere d'interesse artistico. Le sue mura, risalenti a varie fasi costruttive, rappresentano un complesso unitario. Sono molto spesse e quelle più recenti del 1550 si...</p>

<img id="immagine3" src="img/ico/traditionico.jpg" height="115" width="153" class="left" alt="icona" /><h3>Feste e Tradizioni:</h3><p>Sciacca,paese dello "scialo". La manifestazione tradizionale di Sciacca per eccellenza è il Carnevale, che da oltre un secolo ha trovato un fascino particolare, richiamando la presenza di circa duecentomila persone tra forestieri e turisti.
Le sue origini risalgono ad un periodo molto antico, forse all'epoca romana, quando venivano festeggiati i saturnali ed il loro re veniva sacrificato; o meglio, con più probabilità, al 1616 quando il viceré Ossuna stabilì che l'ultimo giorno di festa tutti si dovevano vestire in maschera...</p>

<p>Good luck with your new website!</p>
</div>

<div id="footer">
Copyright &copy; 2007 Andrea Nobili WebMaster. Design by <a title="Home Page del WebMaster" href="http://www.siatec.net/andrea/fotografia/">Andrea Nobili</a>.

<script type="text/javascript" src="http://www.siatec.net/andrea/stats/php-stats.js.php"></script>
<noscript><img src="http://www.siatec.net/andrea/stats/php-stats.php"></img></noscript>

</div>

</div>
</body>
</html>



Gli errori che mi vengono dati dal validatore W3C sono:


1. Error Line 95, Column 69: required attribute "alt" not specified.

…ttp://www.siatec.net/andrea/stats/php-stats.php"></img></noscript>



The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
2. Error Line 95, Column 69: document type does not allow element "img" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "address", "fieldset", "ins", "del" start-tag.

…ttp://www.siatec.net/andrea/stats/php-stats.php"></img></noscript>



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


Come posso risolvere?

Grazie
Andrea

MasterDany
28-02-2008, 20:31
non puoi scrivere <img/> ma devi scrivere <img alt="descrizione"

D4rkAng3l
28-02-2008, 20:45
guarda ho cambiato il footer così:


<div id="footer">
Copyright &copy; 2007 Andrea Nobili WebMaster. Design by <a title="Home Page del WebMaster" href="http://www.siatec.net/andrea/fotografia/" alt="webmaster">Andrea Nobili</a>.

<script type="text/javascript" src="http://www.siatec.net/andrea/stats/php-stats.js.php"></script>
<noscript><img src="http://www.siatec.net/andrea/stats/php-stats.php" alt="stats"></img></noscript>
</div>


ma da questi errori:

1) Line 92, Column 144: there is no attribute "alt".

…w.siatec.net/andrea/fotografia/" alt="webmaster">Andrea Nobili</a>.



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.

2)Line 95, Column 81: document type does not allow element "img" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "address", "fieldset", "ins", "del" start-tag.

…drea/stats/php-stats.php" alt="stats"></img></noscript>



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

come mai?

Grazie
Andrea

MasterDany
28-02-2008, 20:48
il tag html è un tag vuot se vuoi inserire un immagine devi scrivere cosi:
<img src="link" alt="BOH" />

e non cosi:
<img src="link" alt="BOH"></img>

cosi come hai fatto tu non ha significato il tag img si chiude cosi />