Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 20

Discussione: I soliti errori

  1. #1
    Utente di HTML.it L'avatar di Jigen
    Registrato dal
    Feb 2006
    Messaggi
    547

    I soliti errori

    Nonostante abbia letto i vecchi post che riguardavano i seguenti errori che riscontro con il mio CSS, continuo ad avere problemi. Chi è così gentile da aiutarmi?

    Line : 3 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 3 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .testo
    Line : 3 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .testo
    Line : 9 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 9 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .menu
    Line : 9 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .menu
    Line : 12 (Level : 1) You have no background-color with your color : .menu
    Line : 17 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 17 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .intro
    Line : 17 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .intro
    Line : 23 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 23 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .copyright
    Line : 25 (Level : 1) You have no background-color with your color : .copyright
    Line : 30 (Level : 1) You have no background-color with your color : A:link
    Line : 32 (Level : 1) You have no background-color with your color : A:visited

    Questo è invece il foglio di stile:

    .testo {
    font-family : Verdana, Arial, Times new roman;
    font-size : 12px;
    }
    .menu {
    font-family : Trebuchet MS, Times new roman, Arial;
    font-size : 14px;
    font-weight : bold;
    color : #ffffff;
    }
    .intro {
    font-family : Garamond, Book antiqua, Arial;
    font-size : 26px;
    }
    .copyright {
    font-family : Verdana, Arial;
    font-size : 10px;
    color : #808080;
    }
    A:link {
    text-decoration : none;
    }
    A:link {
    color : #800000;
    }
    A:hover {
    border-bottom : 1px dotted #800000;
    }
    A:visited {
    color : #404040;
    }
    A:visited {
    text-decoration : none;
    }


    GRAZIE

  2. #2
    Frontend samurai L'avatar di fcaldera
    Registrato dal
    Feb 2003
    Messaggi
    12,924
    quando si definisce una lista di font è necessario prestare attenzione

    - ai font composti da più parole (es. Times New Roman): in questo caso è richiesto che il nome vengo racchiuso interamente da apici ('Times New Roman')
    - al font generico: è bene specificare come ultimo font una famiglia generica (es. serif oppure 'sans serif')

    circa i warnings sul background puoi ignorarli se le differenza di contrasto e luminosità tra sfondo e colore di primo piano rispettano le indicazioni del w3c.

    In ogni caso puoi sempre definire un background: transparent sugli elementi indicati dal validatore se non puoi specificare un colore diverso.
    Vuoi aiutare la riforestazione responsabile?

    Iscriviti a Ecologi e inizia a rimuovere la tua impronta ecologica (30 alberi extra usando il referral)

  3. #3
    Utente di HTML.it L'avatar di Jigen
    Registrato dal
    Feb 2006
    Messaggi
    547
    Allora:

    - questo è il risultato se provo a mette il background al comando "A:link":

    Line: 30 Context : A:link
    Invalid number : color attempt to find a semi-colon before the property name. add it

    Line: 30 Context : A:link
    Invalid number : background Too many values or values are not recognized : trasparent
    Questo è invece il CSS:

    A:link { color: #800000 background: trasparent }

    - questi sono, invece, i warnings rimasti dopo aver messo gli apici e le famiglie generiche alla fine di ogni class:

    Line : 3 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 3 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .testo
    Line : 9 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 9 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .menu
    Line : 12 (Level : 1) You have no background-color with your color : .menu
    Line : 17 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 17 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .intro
    Line : 23 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 23 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .copyright
    Questo è il nuovo CSS che mi ha rilasciato i warnings su esposti:

    .testo {
    font-family : Verdana, Arial, 'Times New Roman', 'Sans Serif';
    font-size : 12px;
    }
    .menu {
    font-family : 'Trebuchet MS', 'Times New Roman', Arial, 'Sans Serif';
    font-size : 14px;
    font-weight : bold;
    color : #ffffff;
    }
    .intro {
    font-family : Garamond, 'Book Antiqua', Arial, 'Sans Serif';
    font-size : 26px;
    }
    .copyright {
    font-family : Verdana, Arial, 'Sans Serif';
    font-size : 10px;
    color : #808080;
    }
    A:link {
    text-decoration : none;
    }
    A:link {
    color : #800000;
    }
    A:hover {
    border-bottom : 1px dotted #800000;
    }
    A:visited {
    color : #404040;
    }
    A:visited {
    text-decoration : none;
    }
    Grazie.

  4. #4
    Frontend samurai L'avatar di fcaldera
    Registrato dal
    Feb 2003
    Messaggi
    12,924
    1) traNsparent e non trasparent
    2) nel css la famiglia va scritta sans-serif (senza apici)

    Ciao
    Vuoi aiutare la riforestazione responsabile?

    Iscriviti a Ecologi e inizia a rimuovere la tua impronta ecologica (30 alberi extra usando il referral)

  5. #5
    Utente di HTML.it L'avatar di LA VALE
    Registrato dal
    Sep 2003
    Messaggi
    667
    A:link { color: #800000; background: transparent }
    Qui mancava anche il punto e virgola


  6. #6
    Utente di HTML.it L'avatar di Jigen
    Registrato dal
    Feb 2006
    Messaggi
    547
    Correggendo gli apici, mettendo la N a "transparent" ed inserendo il "punto e virgola" questi sono gli errori che ho ottenuto (sono aumentati):

    Line : 3 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 3 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .testo
    Line : 3 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .testo
    Line : 9 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 9 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .menu
    Line : 9 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .menu
    Line : 12 (Level : 1) You have no background-color with your color : .menu
    Line : 17 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 17 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .intro
    Line : 17 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .intro
    Line : 23 font-family: You are encouraged to offer a generic family as a last alternative
    Line : 23 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : .copyright
    Line : 23 (Level : 2) font-family: You are encouraged to offer a generic family as a last alternative : .copyright
    Line : 30 (Level : 1) You have no background-color with your color : A:link
    Questo è il CSS corretto:

    testo {
    font-family : Verdana, Arial, 'Times New Roman', Sans Serif;
    font-size : 12px;
    }
    .menu {
    font-family : 'Trebuchet MS', 'Times New Roman', Arial, Sans Serif;
    font-size : 14px;
    font-weight : bold;
    color : #ffffff;
    }
    .intro {
    font-family : Garamond, 'Book Antiqua', Arial, Sans Serif;
    font-size : 26px;
    }
    .copyright {
    font-family : Verdana, Arial, Sans Serif;
    font-size : 10px;
    color : #808080;
    }
    A:link {
    text-decoration : none;
    }
    A:link {
    color : #800000;
    background : transparent;
    }
    A:hover {
    border-bottom : 1px dotted #800000;
    }
    A:visited {
    color : #404040;
    }
    A:visited {
    text-decoration : none;
    }
    Che fare?

  7. #7
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Ci stai prendendo in giro?
    Rileggiti il post di fcaldera, in particolare il punto 2.
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  8. #8
    Originariamente inviato da Jigen
    Che fare?
    No Sans Serif, ma sans-serif (minuscolo e con il trattino)

  9. #9
    Utente di HTML.it L'avatar di Jigen
    Registrato dal
    Feb 2006
    Messaggi
    547
    Scusate, non avevo proprio fatto caso al punto 2.
    La stanchezza alle volte gioca brutti scherzi!

    Non era mia intenzione far perdere tempo a voi utenti.

    Ho corretto gli errori ed ora mi manca da risolvere un ultimo warnings:

    Line : 25 (Level : 1) You have no background-color with your color : .link
    Cosa c'è di sbagliato nel css?

    A:link {
    color : #800000;
    background : transparent;
    }
    Grazie.

  10. #10
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Anzitutto non e` un errore: e` un warning.
    In pratica ti dice che il validatore non e` in grado di verificare che il contrasto sia sufficiente. Se tu sai che lo sfondo e il color sono diversi (anche se definiti in blocchi diversi), puoi ignorare l'avvertimento.
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

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.