如果browser window
为fully maximized
,我的应用程序看起来会很好。当我collapsed
minimized
时,内容会获得browser window
。
我不需要折叠内容。我已经div
看起来像textarea
,只在%
显示消息。
我的Jsp将是,
<div style="padding-left: 16px;" id="messageLayout">
<div id="messageDisplayArea" >
</div>
</div>
当我点击jquery
时,我的send button
function send(){
name = $("#name").val();
message = $("#message").val();
var time = "Time";
var user = "<div id='user' class='fontStyle'>"+name+"</div>";
var msg = "<div id='msg' class='fontStyle'>"+message+"</div>";
var timeStamp = "<div id='time' class='fontStyle'>"+time+"</div>";
var row = "<div id='msgSet' >"+ user + msg + timeStamp +"</div>";
$("#messageDisplayArea").append(row);
}
我的CSS
将是,
#messageDisplayArea {
height: 250px;
width: 100%;
overflow: auto;
border-color: #6495ED;
white-space: normal;
border-style: solid;
border-width: 1px;
background-color: white;
}
#user {
width: 10%;
float: left;
color: red;
word-wrap: break-word;
}
#msg {
width: 79%;
color: green;
float: left;
word-wrap: break-word;
}
#time {
width: 10%;
float:left;
color: gray;
word-wrap: break-word;
padding-left: 5px;
}
#msgSet {
width: 100%;
float:left;
word-wrap: break-word;
padding-bottom: 5px;
padding-top: 5px;
}
肯定赞赏好的答案。
答案 0 :(得分:0)
尝试删除word-wrap: break-word