Modifying stylesheet properties through JS
by "Rajnish Bhaskar" <r.bhaskar(at)compserv.gla.ac.uk>
|
| Date: |
Wed, 15 Jan 2003 10:49:42 -0000 |
| To: |
hwg-languages(at)hwg.org |
| |
todo: View
Thread,
Original
|
|
Hi folks,
I'm trying to work around a bug in IE's rendering of CSS float by
disabling that rule for IE5+. In several places I've got something
like:
<div class="row">
<span class="first">...</span>
<span class="second">...</span>
</div>
Where classes first and second have float values of 'left' and
'right' (as well as some other stuff). I want to set the float
values to 'none' for these in IE and I'm using the following JS code,
but it's not working. Can anyone help:
==== begin code fragment ====
// disable the CSS 'tables' in IE due to a rendering bug
if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)
{
document.getElementById("first").style.cssFloat= "none";
document.getElementById("second").style.cssFloat= "none";
} // end if
==== end code fragment ====
Cheers,
Raj.
--
Rajnish Bhaskar
r.bhaskar(at)compserv.gla.ac.uk, http://lordofthemoon.com
IT Education Unit, University of Glasgow
http://www.iteu.gla.ac.uk/
--
We're women. We have double standards to live up to.
-- Ally McBeal
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.