I have set the position of tag using following line
<div id="myTestDiv" style="border: 2px solid rgb(100, 149, 237); color:#23238e; background-color:white; position:absolute; top:458px; left:605px; width:210px; height:162px; display:none" >
the problem with this is, its working fine in my machine, but when i deploy the code on some other machine, the position and style (background color) are not开发者_如何转开发 displayed properly...
do any one have any idea, how to set uniform style and position of div for all resolution
Thanks in advance
Looking at your code, I can't see why it doesn't work the same way on all machines.
Since you are hard coding the numbers for top and left, where you see it on the monitor(position) depends on the size of the monitor. On your's it might appear exactly at the center but on a bigger/smaller screen, it won't. It just appears exactly at 458px from top and 605px from left. Try using % values.
The color difference may be due to the hardware ie. the condition ans settings of the monitor.
You can work with percent values. Avoid rgb(xxx, xxx, xxx) syntax. And always check yout html from old to modern browsers.
精彩评论