How do I make my CSS look good in different browsers?
Mу CSS looks ехсеllеnt іn Mozilla..bυt looks tеrrіblе іn IE….іѕ thеrе a code tο mаkе іt look thе same οr dο I hаνе tο lose mу mind аnd keep guessin thе pixel margins ѕο thаt іt looks ехсеllеnt іn both?
Yes to all lol.
There is a way to make it look excellent in IE and Mozilla, but as Mozilla places all margins and borders on the outside of the object, and IE places them on the inside, it is very hard to accommodate both.
You will by no means get them both to look the same if you use any kind of borders or margins, except you use some css hacks that basically trick browsers into using code designed for them only. I will do a small research into them, its been a while since I have used these hacks and edit this post tomorrow sometime when I get the info. In the mean time I am sure there is probably someone who knows what they are already.
Makes a difference if you are using a proper document type. If not, IE really screws a page up when in Quirks Mode. It has enough problems of its own:
http://www.quirksmode.org/bugreports/archives/explorer_7/pointer.html
http://www.positioniseverything.net/articles/ie7-dehacker.html
http://www.communitymx.com/make lucky/condition.cfm?cid=C37E0
http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug
http://cavemonkey50.com/2005/12/the-ultimate-ie-hack-guide/
http://www.positioniseverything.net/explorer.html
http://msdn2.microsoft.com/en-us/library/bb250496.aspx
http://www.my-debugbar.com/wiki/IETester/HomePage
Ron
Well you could make 2 pages 1 for IE 1 for Mozilla, then you make another blank page (this will be the main one) and all it has is javascript that checks what your browser is (IE or Firefox) and redirects you to 1 of the pages.(like if you were using IE you would be redirected to the IE page, if you were using Firefox you would be aimed at to the Firefox page)
Hope it helps!
Simply use different style sheets for different browsers.
The style you will define in style_ie6.css will be applied to only internet explorer 6. Similarly style.css for firefox and style_ie.css for Internet explorer 7 and greater.