Voglio impostare una variabile che mi consenta di caricare una immagine di sfondo per un DIV sulla base per esempio dei giorni pari o dispari (immagini box1.png e box2.png).
Quello che volevo sapere è se risulta possibile impostare con l'IF la scelta all'interno della definizione dello stile.
Io ho:
<style type="text/css">
BODY {font-family:Veranda,Tahoma,Arial,sans-serif; font-size:10pt}
TD {font-family:Veranda,Tahoma,Arial,sans-serif; font-size:8pt}
body{background: #000000 url('gradient2.jpg') repeat-x fixed top;
div.modular{width:230px;
background:url('box1.png') no-repeat bottom left;
padding-bottom:15px}
div.modular div{
background:url('box1.png') repeat-x top left;
padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:0}
</style>
e volevo sapere se si può fare una cosa del genere:
<style type="text/css">
BODY {font-family:Veranda,Tahoma,Arial,sans-serif; font-size:10pt}
TD {font-family:Veranda,Tahoma,Arial,sans-serif; font-size:8pt}
body{background: #000000 url('gradient2.jpg') repeat-x fixed top;
IF variabile=1
div.modular{width:230px;
background:url('box1.png' ) no-repeat bottom left;
padding-bottom:15px}
div.modular div{
background:url('box1.png' ) repeat-x top left;
padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:0}
ELSE
div.modular{width:230px;
background:url('box2.png' ) no-repeat bottom left;
padding-bottom:15px}
div.modular div{
background:url('box2.png' ) repeat-x top left;
padding-left:15px; padding-right:15px; padding-top:15px; padding-bottom:0}
</style>
oppure se per ogni riga che mi serve cambiare devo scrivere con document.write?
Scusate la mia domanda ma sto imparando poco per volta e ho sempre bisogno d'aiuto.
Grazie.
Martina.