I posted this message in Javacript forum. May be CSS forum is a better match. Lets see if I get any response in this forum
I have run into a weird issue and looking for some help from you javascript/css experts. I have attached a simple html file (extension has been changed to txt from html for upload purpose). The html file shows a form that has a drop down field, a button, and a h2 text element.
Our goal is that when a drop down box is clicked, trigger an action that changes the style of the drop down element by highlight the html element. In order to achieve that, we have a onfocus javascript function that is suppose to change the css class when the element is focused. But for reasons we are not sure, anytime we try to do anything with the css class of the element, it changes the layout by shifting the boundary little bit down. To make sure that the new css class is not changing stuff around, we just assign the current css class to the element again – to make sure that there is nothing going behind the scene that we don’t understand – but we still see the same results.
To understand the issue better, I have attached a very simple 30 line html file. You will notice that when the element is clicked, the boundary shifts down. Also, as an experiment, change this line
[CODE].mediumbutton {float:left: margin:bottom 1em}
to
[CODE].mediumbutton {float:left: margin:bottom [B]11[/B]em}
You will see that the shift is much bigger now. So this leads us to believe that somehow when the browser initially loads the page, it is not honoring all the css styles(it does not distinguish between 1em and 11em when it loads the page initially) , and it only honors the 11em change when something is clicked.
We are using IE 7
Any help would be appreciated.
Thanks
Ssquare