tags:

views:

410

answers:

3

There is no scroll bar when browsed with firefox,

but it shows up in IE.

How to track this kind of problem?

A: 

If you are using IE then I would start with using the debugger that comes with IE8.

Also, change the doctype and the modes that IE8 operates in and see if you can detect a pattern.

For example, does it only show up in quirks mode?

Also, what situations cause the scrollbar to show up. Is the div full or half empty?

By using the debugger you can look at the dom and css styles of the component and see if there is a pattern.

James Black
I'm using IE6,can you take a look at http://maishudi.com/jobs.php?
Shore
A: 

Well, I would start by clicking VIEW | SOURCE in my browser menu, but nothing comes up (I'm using IE7), which is pretty weird. I was able to save the file to my desktop and view it in Notepad. Near the top there's a reference to a stylesheet named "fixedBottoomIE6.css" which appears to apply only to IE, which may account for the difference.

So as a general answer to your question, I would begin the debugging process by looking at the source in a text editor.

Update: yeah, the problem is almost certainly that stylesheet, because when I open the file saved to my desktop in IE, I don't get the horizontal scrollbar (I do get it with the online version). The link to the stylesheet is relative, and since the stylesheet isn't on my desktop it isn't applied.

MusiGenesis
@MusiGenesis,No,I tried not to include that file,but the horizontal scroll bar still exists.
Shore
@Shore: But *you're* using IE6, and the stylesheet in question is only applied to IE7 or later (like I'm using). Since it's named "fixedBottoomIE6", I'm guessing that it's meant to make IE7 behave the same way as IE6 behaves by default (which is why you see the scrollbar with or without the stylesheet). But since it's only applied in IE7 or later, that's why you don't get the scrollbar in Firefox (because Firefox *isn't* IE7 or later).
MusiGenesis
@Shore: try removing the "[if lte IE 7]" and "[endif]" comment blocks from around that link, and I'll bet you'll get the scrollbar in Firefox, too (maybe not though).
MusiGenesis
@MusiGenesis,right,after uncomment it occurs too.But how to prevent it from happening?
Shore
I've finally found the root cause,in css there is:body{margin:2px 5px;}.after removing that the scroll bar disapears!But why?
Shore
+1  A: 

I find that 99% of the time, it has to do with padding and defining the width of HTML/Body. I follow no specific approach, but look around for definitions like those. I start every CSS problem with Web Inspector in Safari, since it passes Acid3.

arbales