PDA

View Full Version : Scroll bars



meltedtoons
01 Mar 2010, 07:18 PM
if you take a look at meltedtoons.com/home.html on IE it creates a scroll bar at the bottom of the content box. How do you get rid of it?

Wickham
02 Mar 2010, 01:05 AM
In my 1024*768 screen resolution there is a small horizontal scrollbar in IE7 and Firefox. It's because your div and image are coded with width: 1005px; but a window of 1024px less a vertical scrollbar is only about 1006px wide, it seems enough but obviously isn't. Scrollbars can vary from one browser to another.

I changed the widths to 970px and the scrollbar disappeared:-


<div style="top: -1px; left: -1px; width: 970px;"
id="wrapper"><!--was 1005px;-->
<br />
<br />
<br />
<br />
<img src="images/websitebanner.png" style="width: 970px; height:
250px;" alt="" /><br /><!--was 1005px; -->


Edit, don't bother to edit as above,

The reason 1005px doesn't fit in a window of 1024px less 18px scrollbar, leaving 1006px, is that your body has default margins of 20px;

Add this to a stylesheet


body { margin: 0; }


and with the above code your original 1005px width doesn't need reducing to 970px in Firefox although IE7 shows a very small horizontal scrollbar until the two widths are reduced to 1004px ( your #wrapper width style of 800px is in co***ict with the inline style of 1005px in the body markup but the body markup is taking precedence.)