i have following css class
.QueueHeader {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #AAAAAA;
border-radius: 5px 5px 5px 5px;
cursor: pointer !important;
height: 91px !important;
width: 53% !important;
}
and i have wriiten following code in javascript :
var divContent = document.getElementById("content");
var divQueueNumber = document.createElement("div");
divQueueNumber.className = "QueueHeader";
divQueueNumber.style.height = '190px';
divContent.appendChild(divQueueNumber);
i want to set height of div Element dynamically at creation time, i have set height in javascript code.. but it doesn’t effect..
how can i set it?
Thanks
Its because you have added the !importance in your CSS .
CSS rules marked !important take precedence over later rules. Normally in CSS the rules work from top to bottom, so if you assigned a new style to an element further down the style sheet or in a secondary style sheet then the later rule would take precedence. !important ensures that this rule has precedence.