I create an element by Javascript and apply it to another element, I also have a CSS File with styles for this new element, I check the code, the new element exists and has the given ID and class name, but my CSS is not used. The code looks like this:
var mainDiv=document.createElement("DIV");
mainDiv.id="ambiVid_controls";
mainDiv.className="ambiVid_controls";
Conts.parentNode.appendChild(mainDiv);
And the CSS:
.ambiVid_controls{
position:absolute !important;
bottom:15px ;
width:60% !important;
height:50px !important;
margin-left:50% !important;
background-color:#333 !important;
z-index:1000 !important;
}
Anyone have any ideas why this gets ignored or is there any known issue with ApplyChild and CSS?
The browser is Safari, if this matters.
Contsand is it reachable fromdocument.body?