Friday, November 27, 2009

How do I make a div with a border the same size in FireFox and IE?

%26lt;div style="width: 210px; background-color: #B5EDBC; border: 1px solid #489D65;"%26gt;



in FireFox the width is actually becoming 212px because the border is being added to the width. In IE its showing up as 210 pixels. How do I get it to be the same width in each?



I am using %26lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"%26gt;



Thanks!



How do I make a div with a border the same size in FireFox and IE?microsoft access



Try using the Strict DocType. Hopefully, that fixes the rendering discrepancies. Although, be warned that other issues may arise if there are problems in your markup.



How do I make a div with a border the same size in FireFox and IE?windows mobile 6 internet explorer



Actually the box should be the same width. This issue is with how you are measuring the width. If you are using JavaScript like elementRef.width or element.clientWidth, you will get different measures due to the different browsers and the rendering mode quirks of each browser.



see: http://en.wikipedia.org/wiki/Internet_Ex...
Dear,,



It's Not How Getting Width, Print Screen %26amp; use Paint To Do This IE%26lt;2px From FireFox



We Know The compatabilty Issues Between Browser Can Be Done By Scripting...



So You Can Make A Script When Body Loads



if firefox



obj=document.getElementsByTagName("DIV...



for (i=0;i%26lt;obj.length;i++)



obj[i].style.width=obj[i].style.width-...



Don't Know The Write Syntacs



Complete It ;)
Use the following doctype to switch IE to standards-compliant mode:



%26lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"



"http://www.w3.org/TR/html4/loose.dtd"%26gt;
What i have learned when it comes to cross-browser-compatibility...



USE ONLY PIXELS AND PERCENTAGES...



because different browser see units differently, pixels on the other hand are universal...



So a computer that has Firefox, Opera, IE, Netscape will see the same page at the same size, provided that the user does not change the resolution of the monitor for each browser.



What I'm trying to say is that if you use pixels and percentages what happens is that you insure that other browsers see what you intend them to see at the scale that you originally made.



I hope this helps

No comments:

Post a Comment

 
computer repair