Problem with CSS Programming on specific browser

Asked By 10 points N/A Posted on -
qa-featured

I need some help! I made a website using notepad++ with a lot of divisions. When I run my website with Mozilla Firefox and Google chrome everything is where it ought to be, but when I run it on an opera or Internet explorer browser. The divisions get scattered everywhere. Is there a way to make the divisions be the same as in the other browsers?

SHARE
Answered By 0 points N/A #83439

Problem with CSS Programming on specific browser

qa-featured

Different browsers interpret CSS in different ways. You need to detect what browser is used and try to apply the right CSS code for that browser. Say for example that you want to have space for your header to your content area, you should consider that space gap in IE is kind a different from Mozilla or Opera. Mozilla has a wider gap than IE so if you give 25px space in IE that could be 10px in Mozilla. You can use child selector since IE does not understand that and ignore it. Just for example in this code:

#header {margin-bottom: 3em;}

#header>body {margin-bottom: 1em;}

IE can't understand the second line of code so it would ignore and use the first line of CSS instead. Also you could write CSS codes for specific browsers by using browser detection.

Related Questions