Themans

How Can I Make a Scrollable DIV-Box?

Asked by Themans 2 years ago div scroll


Joel Reyes
0
 
Below I've added code I was able to find that will allow you to make your Div boxes scrollable like an iFrame:

<!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>

Source: codedump.jonasjohn.de

by Joel Reyes 2 years ago

Answer this question

How Can I Make a Scrollable DIV-Box?

0 errors found:

 
0