Ho reso riproducibile il problema in questo script qua sopra.Codice HTML:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Documento senza titolo</title> <script type="text/javascript"> <!-- function get_body_size() { alert(document.body.style.fontSize); } //--> </script> <style> body {font-size:76%} </style> </head> <body> <a href="javascript:get_body_size()">Grandezza font body</a> </body> </html>
In pratica cliccando su "Grandezza font body" l'alert che si ottiene è vuoto.
Se invece setto lo stile direttamente nel tag facendo:
<body style="font-size:76%">
allora funziona tranquillamente... Il problema è che io voglio usare il foglio di stile! come fare?...

LinkBack URL
About LinkBacks
