DIV模拟textarea

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title><style type="text/css">

.test_box p
{
margin: 0;
}
.test_box
{
width: 400px;
min-height: 120px;
_height: 120px;
max-height: 300px;
/*margin-left: auto;
margin-right: auto;*/
padding: 3px;
outline: 0;
border: 1px solid #a0b3d6;
font-size: 12px;
word-wrap: break-word;
overflow-x: hidden;
overflow-y: auto;
_overflow-y: visible;
}
.test_box:focus
{
-moz-box-shadow: 0 0 6px rgba(0, 100, 255, .45);
-webkit-box-shadow: 0 0 6px rgba(0, 100, 255, .45);
box-shadow: 0 0 6px rgba(0, 100, 255, .45);
border-color: #34538b;
}
</style>
</head>
<body>
<div id="main">
<div id="body" class="light">
<div id="content" class="show">
<div class="demo">
<div id="testBox" class="test_box" contenteditable="true">
</div>
</div>
</div>
</div>
</div>
<div><input type="button" value="提交" id="view" /></div>
</body>
</html>

posted on 2013-06-29 11:55  Tadpole  阅读(273)  评论(0编辑  收藏  举报

导航