Mar 5, 2010

Div tag scroll bars

I'm not sure if any of you have run into this problem but when I was outputting my XML to my web site I was constantly overflowing the div window with results. At first I was trying to minimize the results by creating for loops that only printed a certain number of results. While this was effective it didn't allow me to have as much content as I wanted to display. However, there was a solution.

I did a search in Google for "Scroll bar DIV tag" I was surprised by the amount of results but I was more surprised at how simple it was. You can check out the results of the search here. Anyway the only thing I had to do was to put this simple bit of code into my style sheet.

overflow: auto;

That's it, not too complicated but oh so effective for presenting tons of results in a small window in order to fit into web site. This little gem allowed me to stuff 25 news stories into a small widow within the page. Here is the results.


1 comment:

  1. I did have this same problem. I also had the problem of information overflowing the div tag and going outside of it. I'm glad you found a fix, I'll definitely probably be using this on my project.

    ReplyDelete