Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Link, hover e visited all'interno del tag <a>

    Ciao a tutti, come posso impostare le caratteristiche di un link (normale, al passaggio del mouse e visitato) senza usare un css esterno e senza mettere il tag style nell'head, perchè trattasi di un sistema cms antiquato ?...posso agire solo all'interno del tag <a> o del <td> che contiene <a>.
    in pratica:
    ne css esterno, ne css incorporato, solo css in linea?

    Grazie a chi mi risponderà !

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Che io sappia, non si possono sistemare le pseudoclassi tramite il CSS in linea.

    Pero` il CSS lo puoi anche inserire dentro il codice del <body>: non e` una cosa pulita, ma non ci sono impedimenti sintattici.
    Naturalmente in tal caso il CSS ha effetto sugli elementi definiti da quel punto in poi

    <body>
    ...
    <style ...>
    a:link { ...}
    a:hover { ... }
    </style>
    <a href="..." >
    ...
    </body>
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  3. #3
    si infatti lo posso mettere anche dentro al body..il problema, che ho dimenticato di dire nel post precedente, è che devo rendere tutto xhtml strict 1.0..e che quindi il metodo da te segnalato me lo segna errore.

    per ora ho trovato questo metodo che funzione su tutti i browser e che non mi segna come errore...

    <a style="color:#090;" onmouseover="this.style.color='#f00';" onmouseout="this.style.color='#090';" > TESTO LINK </a>

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Con il tuo metodo utilizzi Javascript. Non e` proprio la soluzione ideale ...

    Invece se vuoi inserire un oggetto CSS o JS dentro il file XHTML Strict puoi usare il commento CDATA:
    codice:
    <style type="text/css">
    /*<![CDATA[*/
    a { ... }
    a:hover { ... }
    /*]]*/
    </style>
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  5. #5
    ho provato ma purtroppo non basta inserire le proprietà dentro a CDATA ....pare che il problema sia proprio il tag style che non può essere dentro al body

    questo è il risultato:

    Line 59, Column 25: document type does not allow element "style" here.

    <style type="text/css">

    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

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.