By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,449 Members | 934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,449 IT Pros & Developers. It's quick & easy.

DPI Settings problem

P: 17
Hi All,

Iam facing problem with DPI(dot per inch) settings.i was hardcoded some of the div tags arguments (Like left=10px,heigth=250 px).My code is working perfectly for 96 DPI.But incase of 120 DPI, my div tags are overlapping together..can you please tell me how to set the div tag argument(left,height,width) values dynamically depends upon DPI settings in javascript.

Thanks in advance..

Regards
akaley
Sep 11 '08 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
Is this for the screen or the printer?
Sep 11 '08 #2

P: 17
Is this for the screen or the printer?

For screen only..In screen div's are overlapping together
Sep 12 '08 #3

acoder
Expert Mod 15k+
P: 16,027
Only IE makes available the deviceXDPI/deviceYDPI properties via the Screen object. In your HTML/CSS, try using percentages instead of pixels. Pixels are supposed to be relative to the viewing device, but percentages may work better for you.
Sep 12 '08 #4

P: 17
Hi Acoder,

Thanks for your reply,could you please guide me how can i get percentage calcutions related to DPI..in my existing code someone has hardcoded div tag attribute values related to 96 DPI.

How can i modify those things to work for all the DPI settings.






Regards,
Akaley
Sep 15 '08 #5

acoder
Expert Mod 15k+
P: 16,027
I don't have much experience in this area. You could try a bit of trial and error. See how it looks in 96 DPI and work out the rough percentages and work from there.
Sep 15 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.