Visualizzazione dei risultati da 1 a 8 su 8

Discussione: XHTML codice giusto?

  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    59

    XHTML codice giusto?

    Salve, ho una pagina molto semplice, strutturata in questo modo,
    siccome sono le prime esperienze di xhtml, volevo sapere se andava bene cosi'.
    Grazie

    <!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "DTD/xhtml1-strict.dtd">
    <html><head><title>login</title>
    <style type="text/css">
    body {
    margin:20px 20px 0px 20px;
    }
    #main {
    border:1px solid #000;
    background:#fff;
    }
    #main #menu {
    border-left:1px solid #000;
    border-bottom:1px solid #000;
    float:right;
    width:230px;
    background:#eee;
    margin:0px 0px 10px 10px;
    }
    p,h1,pre {
    margin:0px 10px 10px 10px;
    }
    h1 {
    font-size:14px;
    padding-top:10px;
    }
    #menu p { font-size:10px}
    </style>
    </head><body>
    <div id="main">
    <div id="menu">
    <h1>menu</h1>
    <font color="red">Agenda
    </font>

    inserisci

    ricerca

    visualizza

    modifica

    </div>
    <form method="post" action=login.php>
    <fieldset>
    <legend>Inserisci i dati per accedere:</legend>
    <fieldset>
    <label for="email" accesskey="E">Email</label>
    <input type="text" name="email" id="email" tabindex="1" size="25" maxlength="32" title="Inserisci indirizzo E-mail" />


    <label for="psw" accesskey="P">Password</label>
    <input type="password" name="psw" id="psw" tabindex="2" size="20" maxlength="20" title="Inserisci password" />


    </fieldset>
    </fieldset>
    <input type="submit" name="Accedi" value="Accedi" title="Accedi" />
    </form>


    </body>
    </html>
    #Software is like sex: it's better when it's free!! (indovinate di chi e'?)

  2. #2
    Puoi controllare online la correttezza formale del tuo files.
    http://validator.w3.org/
    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    59
    Ho validato la pagina secondo il W3C
    ma...
    mi da' ch ci sono 4 errori...
    ma non so come eliminarli..


    This page is not Valid XHTML 1.0 Strict!
    Below are the results of attempting to parse this document with an SGML parser.

    Line 42, column 27: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
    <form method="post" action=login.php>
    ^
    Line 54, column 66: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
    ...bmit" name="Accedi" value="Accedi" title="Accedi" />
    ^
    Line 57, column 6: end tag for "div" omitted, but OMITTAG NO was specified
    </body>
    ^
    Line 33, column 0: start tag was here (explain...).
    <div id="main">
    ^
    Source Listing
    Below is the source input I used for this validation:

    1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    3: <html xmlns="http://www.w3.org/1999/xhtml"><head>
    4: <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    5:
    6: <title>login</title>
    7: <style type="text/css">
    8: body {
    9: margin:20px 20px 0px 20px;
    10: }
    11: #main {
    12: border:1px solid #000;
    13: background:#fff;
    14: }
    15: #main #menu {
    16: border-left:1px solid #000;
    17: border-bottom:1px solid #000;
    18: float:right;
    19: width:230px;
    20: background:#eee;
    21: margin:0px 0px 10px 10px;
    22: }
    23: p,h1,pre {
    24: margin:0px 10px 10px 10px;
    25: }
    26: h1 {
    27: font-size:14px;
    28: padding-top:10px;
    29: }
    30: #menu p { font-size:10px}
    31: </style>
    32: </head><body>
    33: <div id="main">
    34: <div id="menu">
    35: <h1>menu</h1>
    36: Agenda

    37: inserisci

    38: ricerca

    39: visualizza

    40: modifica

    41: </div>
    42: <form method="post" action=login.php>
    43: <fieldset>
    44: <legend>Inserisci i dati per accedere:</legend>
    45: <fieldset>
    46: <label for="email" accesskey="E">Email</label>
    47: <input type="text" name="email" id="email" tabindex="1" size="25" maxlength="32" title="Inserisci indirizzo E-mail" />
    48:

    49: <label for="psw" accesskey="P">Password</label>
    50: <input type="password" name="psw" id="psw" tabindex="2" size="20" maxlength="20" title="Inserisci password" />
    51:

    52: </fieldset>
    53: </fieldset>
    54: <input type="submit" name="Accedi" value="Accedi" title="Accedi" />
    55: </form>
    56:

    57: </body>
    58: </html>
    #Software is like sex: it's better when it's free!! (indovinate di chi e'?)

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    59
    Sono riuscito a capire dove stavano i 3 errori..
    Ma non sono riuscito ad eliminare questo:

    This page is not Valid XHTML 1.0 Strict!
    Below are the results of attempting to parse this document with an SGML parser.

    Line 54, column 66: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
    ...bmit" name="Accedi" value="Accedi" title="Accedi" />
    ^
    Source Listing
    Below is the source input I used for this validation:

    1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    3: <html xmlns="http://www.w3.org/1999/xhtml"><head>
    4: <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    5:
    6: <title>login</title>
    7: <style type="text/css">
    8: body {
    9: margin:20px 20px 0px 20px;
    10: }
    11: #main {
    12: border:1px solid #000;
    13: background:#fff;
    14: }
    15: #main #menu {
    16: border-left:1px solid #000;
    17: border-bottom:1px solid #000;
    18: float:right;
    19: width:230px;
    20: background:#eee;
    21: margin:0px 0px 10px 10px;
    22: }
    23: p,h1,pre {
    24: margin:0px 10px 10px 10px;
    25: }
    26: h1 {
    27: font-size:14px;
    28: padding-top:10px;
    29: }
    30: #menu p { font-size:10px}
    31: </style>
    32: </head><body>
    33: <div id="main">
    34: <div id="menu">
    35: <h1>menu</h1>
    36: Agenda

    37: inserisci

    38: ricerca

    39: visualizza

    40: modifica

    41: </div>
    42: <form method="post" action="login.php">
    43: <fieldset>
    44: <legend>Inserisci i dati per accedere:</legend>
    45: <fieldset>
    46: <label for="email" accesskey="E">Email</label>
    47: <input type="text" name="email" id="email" tabindex="1" size="25" maxlength="32" title="Inserisci indirizzo E-mail" />
    48:

    49: <label for="psw" accesskey="P">Password</label>
    50: <input type="password" name="psw" id="psw" tabindex="2" size="20" maxlength="20" title="Inserisci password" />
    51:

    52: </fieldset>
    53: </fieldset>
    54: <input type="submit" name="Accedi" value="Accedi" title="Accedi" />
    55: </form>
    56:
    57: </div>
    58: </body>
    59: </html>
    #Software is like sex: it's better when it's free!! (indovinate di chi e'?)

  5. #5
    1.
    Il tag font e' deprecato, br deve essere chiuso
    <font color="red">Agenda
    </font>
    <span style="color:red;">Aganda</span>


    2.
    Hai aperto inutilmente due vole fieldset
    <fieldset>
    <legend>Inserisci i dati per accedere:</legend>
    <fieldset>
    [...]
    </fieldse>
    </fieldse>


    <fieldset>
    <legend>Inserisci i dati per accedere:</legend>
    [...]
    </fieldset>

    3.
    Non puoi mettere br fuori dagli elementi di block, inoltre devi chiudere main



    </body>

    </div>
    </body>

    ...dovrebbe andare.


    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  6. #6
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    59
    Ciao, grazie per le risposte tempestive..

    Ho fatto le modifiche che mi hai detto e ho provato a rivalidare la pagina..
    C'e' sempre un errore:

    Encoding: iso-8859-1
    Doctype: XHTML 1.0 Strict
    Errors: 1

    Note: The Validator XML support has some limitations.
    This page is not Valid XHTML 1.0 Strict!
    Below are the results of attempting to parse this document with an SGML parser.

    Line 55, column 66: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
    ...bmit" name="Accedi" value="Accedi" title="Accedi" />
    ______________________________________ ^
    Source Listing
    Below is the source input I used for this validation:

    1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    3: <html xmlns="http://www.w3.org/1999/xhtml"><head>
    4: <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    5:
    6: <title>login</title>
    7: <style type="text/css">
    8: body {
    9: margin:20px 20px 0px 20px;
    10: }
    11: #main {
    12: border:1px solid #000;
    13: background:#fff;
    14: }
    15: #main #menu {
    16: border-left:1px solid #000;
    17: border-bottom:1px solid #000;
    18: float:right;
    19: width:230px;
    20: background:#eee;
    21: margin:0px 0px 10px 10px;
    22: }
    23: p,h1,pre {
    24: margin:0px 10px 10px 10px;
    25: }
    26: h1 {
    27: font-size:14px;
    28: padding-top:10px;
    29: }
    30: #menu p { font-size:10px}
    31: </style>
    32: <link href="stile1.css" rel="stylesheet" type="text/css" />
    33:
    34: </head><body>
    35: <div id="main">
    36: <div id="menu">
    37: <h1>menu</h1><span style="color:red;">Agenda</span>

    38: inserisci

    39: ricerca

    40: visualizza

    41: modifica

    42: </div>
    43: <form method="post" action="login.php">
    44: <fieldset>
    45: <legend>Inserisci i dati per accedere:</legend>
    46:
    47: <label for="email" accesskey="E">Email</label>
    48: <input type="text" name="email" id="email" tabindex="1" size="25" maxlength="32" title="Inserisci indirizzo E-mail" />
    49:

    50: <label for="psw" accesskey="P">Password</label>
    51: <input type="password" name="psw" id="psw" tabindex="2" size="20" maxlength="20" title="Inserisci password" />
    52:

    53:
    54: </fieldset>
    55: <input type="submit" name="Accedi" value="Accedi" title="Accedi" />
    56: </form>
    57:
    58: </div>
    59: </body>
    60: </html>
    #Software is like sex: it's better when it's free!! (indovinate di chi e'?)

  7. #7
    L'errore

    Line 55, column 66: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
    ...bmit" name="Accedi" value="Accedi" title="Accedi" />
    significa che <input ... /> deve stare dentro ad un elemento di block. Con la DTD XHTML 1.x Strict non puoi scrivere

    <input type="text" value="" />

    ma dovrai, ad esempio



    <input type="text" value="" /></p>

    nel tuo caso uno degli input (l'ultimo) e' rimasto fuori dal tag <fieldset>

    dovrai scrive quindi

    54: <input type="submit" name="Accedi" value="Accedi" title="Accedi" />
    55: </fieldset>
    56: </form>

    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  8. #8
    Utente di HTML.it
    Registrato dal
    Jun 2003
    Messaggi
    59
    ok, grazie tantissimo!!
    perfetto!!
    #Software is like sex: it's better when it's free!! (indovinate di chi e'?)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.