Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Am generating an html file through Javascript and assigning to a div tag(not a server control)
it was displaying as same in all browsers no problem for that.So now i want to calculate that particular div height and it was coming differently in diferent browsers like (IE ,Chrome,...).

How can i show the height same in all browsers??
And why it was not coming same for all browsers??



Thanks All
Posted
Comments
Actually the html you generating will be rendered differently in different browsers, unless you provide style property to it.

So, try to provide some style information to that content and try to use "%" and not "px" (pixels).

Otherwise, provide some code or that generated html file contents to look at.
mouli_13579 4-Mar-13 2:11am    
Thanks Tadit Dash,

am applying css also but am not applying any specific heights to it ,it may be auto maximum
if want to see what am facing exactly means u can check dis in this Jsfiddle
http://jsfiddle.net/mouli_13579/k3UuK/5/

i uploaded a sample html there
Just open this in different browsers and check once then you can be able to get me exactly.


Thank You again.
Don't worry, I removed the unwanted and edited your comment also.

I will come back to you, after I investigate your issue.

Thanks,
Tadit
mouli_13579 4-Mar-13 2:27am    
Ok Tadit thanks
I checked the jsFiddle in different browsers.

Actually the images are not showing up, instead their border is showing without any image in IE and Chrome.

But in Firefox, as there are no images, so it is not even showing the borders and the errors are showing on console tab of FireBug.

And clicking on "check this height" link, it shows different heights.

So, do one thing.
Just try to convert the height, width you have defined for all elements in the html to % instead of pixels.
If you convert all the height, widths of images, tr, td, tables etc..., then it will render correctly and the height will be the same in all the browsers...

Thanks...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900