|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Bannato
Iscritto dal: Mar 2004
Città: Roma
Messaggi: 2682
|
[CSS] Caricare due css diversi a seconda della risoluzione dello schermo
Ciao,
posso far caricare due CSS diversi a seconda della risoluzione dello schermo? che ne sò se uno ha lo schermo impostato su 1280X1024 allora carica un CSS, altrimenti ne carica un altro....come posso fare?magari con javascript o qualcosa del genere...sob Grazie Andrea |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2002
Messaggi: 3359
|
Esempio
Codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>bla bla blaaa</title> <script type="text/javascript"> var res=screen.width+"x"+screen.height; if(res=="1680x1050"){ document.write( "<style type=\"text/css\">"+ ".change-on-res{"+ "font-size:200%;"+ "font-weight:bold;"+ "color:#FF0000;"+ "}"+ "</style>"); } else{ document.write( "<style type=\"text/css\">"+ ".change-on-res{"+ "font-size:50%;"+ "color:#000000;"+ "}"+ "</style>"); } </script> </head> <body> <div class="change-on-res">CIAO</div> </body> </html> Ultima modifica di MEMon : 31-01-2008 alle 12:26. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 14:28.