Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Utente di HTML.it L'avatar di Cream
    Registrato dal
    Feb 2002
    Messaggi
    534

    html validato... errore

    ciao a tutti,

    ho validato l'html di un sito che ho fatto e va tutto bene tranne per il fatto che mi da errore su l'attributo background usato su una colonna

    il codice incriminao è questo:
    codice:
    <td background="images/quattro.gif" WIDTH="372" align="right">
    mentre l'errore del W3C è questo:
    codice:
    Line 21, column 16: there is no attribute "BACKGROUND"
    codice:
    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.

    poi vado a vedere gli attributi dell'HTML4 e vedo che non esiste l'attributo background sui td ma solo su table...

    e allora come posso mettere un'immagine di sfondo ad una colonna???

  2. #2
    Devi usare i CSS.

    www.html.it/css
    FEDERIX.IT - [Pillola] GRAFICA DEI FORM

    ...ho ancora quella forza che ti serve, quando dici "Si comincia!"

  3. #3
    boolbo
    Guest
    Veramente esiste:

    <td background="ipublish.gif">

    a me funziona a meraviglia.

    Forse è il DTD specificato nel Doctype che non ti accetta quest'attributo...sì prova con i CSS.

  4. #4
    Utente di HTML.it L'avatar di floyd46
    Registrato dal
    Feb 2002
    residenza
    Apulia
    Messaggi
    2,641

    Re: html validato... errore

    ciao
    il background non dovresti metterlo nella pagina html, ma nel foglio di stile.

    prova così.
    ciao
    "Le persone che realizzano layout con tabelle annidate, spacer gif o che ignorano l'accessibilità non possono più definirsi professionisti." Andy Clarke
    --------------------------------

    www.extrowebsite.com

  5. #5
    Utente di HTML.it L'avatar di Cream
    Registrato dal
    Feb 2002
    Messaggi
    534
    <Federix>

    quindi usando i css per mettere lo sfondo alle colonne nion mi da errore??


    boolbo a vedere si vede bene e in tutti i browser ma io sto parlando della validazione del W3C

    e comunque grazie provo con i css

  6. #6
    Se il CSS è stato dichiarato correttamente non restituisce errore. L'attributo background="" è stato deprecato nella versione 4.0 di HTML e superiori, quindi si deve ricorrere ai CSS.
    FEDERIX.IT - [Pillola] GRAFICA DEI FORM

    ...ho ancora quella forza che ti serve, quando dici "Si comincia!"

  7. #7
    Utente di HTML.it L'avatar di lnessuno
    Registrato dal
    Feb 2002
    Messaggi
    2,732
    se non hai già un foglio di stile prova così:


    <td style="background-color: #333333; ">

  8. #8
    Utente di HTML.it L'avatar di Cream
    Registrato dal
    Feb 2002
    Messaggi
    534
    il foglio di stile ce l'ho ed è anche validato.. e non mi serve per il colore ma per un'immagine di sfondo.

  9. #9
    Utente di HTML.it L'avatar di Sgnafurz
    Registrato dal
    Mar 2003
    Messaggi
    2,182
    Originariamente inviato da boolbo
    Veramente esiste:

    <td background="ipublish.gif">

    a me funziona a meraviglia.

    Forse è il DTD specificato nel Doctype che non ti accetta quest'attributo...sì prova con i CSS.
    infatti è espressamente vietato nella DTD Strict

  10. #10
    Utente di HTML.it L'avatar di bagu
    Registrato dal
    Mar 2003
    Messaggi
    620
    prova ad usare backround-image
    ciao paolo
    Non so se Dio esiste ma se non esiste ci fa una figura migliore!
    - S. Benni -

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 © 2025 vBulletin Solutions, Inc. All rights reserved.