I have following code where I have text input for user to enter information and panel above the text input to display what user typed. I want the panel above the text field to be set to some height and as it gets overflowing it should be scrollable.
<div class="row-fluid" style="max-height:10;overflow-y: scroll;">
<div class="panel-body" style="max-height:10;overflow-y: scroll;">
{% for message in messages %} {% module Template("message.html", message=message) %} {% end %}
</div>
</div>
<div class="row-fluid">
<form action="/a/message/new" method="post" id="messageform" class="span12">
<table>
<tr>
<td>
<input name="body" id="message" style="width:500px">
</td>
<td style="padding-left:5px">
<input type="submit" value="{{ _(" Post ") }}">
<input type="hidden" name="next" value="{{ request.path }}">{% module xsrf_form_html() %}</td>
</tr>
</table>
</form>
</div>
In addition I want section above to be fix and not expand to the bellow section.
<div class="row-fluid">
<div class="span4">
testet seetsetsetset
</div>
<div class="span4">
testsetstse estsetset
</div>
<div class="span4">
setsetetsets setsetset
</div>
</div>
I am using the bootstrap version publish in this tutorial: http://taskmessenger.com/blog/index.php/coderdojo-twitter-bootstrap-lesson-2-create-the-layout-page/
Also following css is been used to format the user input and the results of the reply, Was not able to do it in bootstrap way it would be great if few pointers can be given on that too:
body {
background: white;
margin: 10px;
}
body,
input {
font-family: sans-serif;
font-size: 10pt;
color: black;
}
table {
border-collapse: collapse;
border: 0;
}
td {
border: 0;
padding: 0;
}
#body {
position: absolute;
bottom: 10px;
center: 10px;
}
#input {
margin-top: 0.5em;
}
#inbox .message {
padding-top: 0.25em;
}
#nav {
float: right;
z-index: 99;
}
2
Answers
Is not valid value, there should be “px”, “em”, “cm” or “%” at the end. See if that helps.
The
height
value you set needs to be a measurable value (ie.px
,em
,%
, etc.). Further, you only need to declare it for one of the containers. You can also hide the scrollbar when it isn’t needed by settingoverflow-y
toauto
instead ofscroll
.You also have invalid CSS. There is no
center
property in CSS. I’ve commented out in my example.The only change I made was to change
to
Here’s the fully code:
Note: Here’s a Bootply to better demonstrate the appearance: http://www.bootply.com/1LGjrUomIl