rohitsaroha125 rohitsaroha125 - 7 months ago 11
HTML Question

Vertical scroll bar not working or showing up

I have created this html file where data is loaded using ajax requests but there is an awkward problem going with it. It is not showing me vertical scroll in any browser.

html

<div id="register1">
<h2><center>Live Conversation</center></h2>
<div id="showall">
//data is loaded here using ajax request
</div>
<div id="white">
<center>
<textarea rows="5" cols="97" id="writebody"></textarea>
</center>
<br> // $msg is already set in my file
<input type="button" name="enterbody" value="send" id="enterbody<?php echo $msg; ?>">
</div>
</div>


css

#register1 {
background: #f0f0f0;
color: black;
margin-left: auto;
margin-right: auto;
width: 800px;
margin-top: 100px
}

#white {
background: white;
height: auto
}


what might be the problem.

Answer

Set a height on your results container #showall

#showall {
  height: 400px;
  overflow: auto;
}