javascript - Why is IE7 ignoring the css background? -


i trying add div elements using inject of mootools. here part of code

  var elm = document.createelement('div');   elm.setattribute('id', 'leftheader');   elm.setattribute('class', 'leftheader');   var div_before = document.getelementbyid('w1');   var aux = div_before.parentnode;   aux.insertbefore(elm, div_before);   var elm2 = document.createelement('div');   elm2.setattribute('id', 'rightheader');   elm2.setattribute('class', 'rightheader');   var div_before2 = document.getelementbyid('w1');   aux2 = div_before2.parentnode;   aux2.insertbefore(elm2, div_before2); 

and stylesheet below

.leftheader {     background: #e64626 url("bgleft.png") 0 0 no-repeat;     float: left;     position: absolute;     width: 40%;     height: 358px; } .rightheader {     background: #e64626 url("bgright.png") right 0 no-repeat;     float: right;     position: absolute;     width: 60%;     left: 40%;     height: 358px; } 

you notice background showing in browsers expect ie7. :( not sure why. can me in figuring out why fails load background in ie7? have checked console. not seem show error or warning either

after bit of debugging realized not loading stylesheet in ie7. wonder why?

try setting elm2.classname = 'rightheader'; instead.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -