Why doesn't scrollbar work in IE?

I created a scrollbar and it works fine in google chrome and firefox, but not in IE. I have a feeling that it is related to the line-height property.

My code is:

Html:

<div id="scrollbar"><br /></div> 

Css:

 #scrollbar { margin-top: 10px; height: 220px; float: right; overflow-y: scroll; line-height: 403px; } 

Here is my jsfiddle .

Anyway, to get this to work in IE?

+5
source share
2 answers

Change <br/> to &nbsp; . IE raises non-breaking space a little better than the <br> tag. http://jsfiddle.net/s9sycey1/3/

+3
source

I get it. Instead of <br /> I used <span class="hidden">/</span> , and I set my css to .hidden { visibility: hidden } . Here is my updated jsfiddle .

0
source

All Articles