Thursday, May 1, 2008

CSS Scroll Box instead of iFrames

Websites in a Flash MascotYou've probably heard "iframes are horrible with search engines." Well, they are.

I recently had a client want me to create scroll boxes for their website so they could fit 1000+ words into a 300x457 pixel scroll box. How can I create this scroll box without the iframe? Well, you are about to find out.

Here is how you use CSS to create a scroll box instead of an iframe:


We're going to use a css attribute called "overflow," and by setting it to auto, it turns a normal div into a scroll box!

#scrollbox {
  width:300px;
  height:457px;
  overflow:auto;
}
<div id="scrollbox"> *enter endless amounts of words*</div>


That's it!
Enjoy

Labels: ,

0 Comments:

Post a Comment

<< Home