/ Published in: CSS
Shows how to create a DIV box that is scrollable and looks like a IFRAME.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>example page</title> <style type="text/css" media="all"> body { font-family: Verdana; font-size: 90%; } #scroll_box { border: 1px solid #ccc; height: 120px; width: 400px; overflow: auto; margin: 1em 0; } </style> </head> <body> <div id="page"> <h1>Title</h1> <div id="scroll_box"> <p> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> Put a long text in here. It will be scrollable.<br/> </p> </div> <p> This content follows after the scrollable box. </p> </div> </body> </html>
URL: http://codedump.jonasjohn.de/snippets/scrollable-div-box.htm