代码如下:
<body onload="init()">
<div class="contentlayout3" style ="text-align:center">
@using (Html.BeginForm())
{
<div style="text-align:left; width:98%">
<h3>时间</h3>
</div>
<div width:98%">
@Html.TextBoxFor(m => m.RecordTime, new { @style = "width:600px;Height:40px" })
@Html.ValidationMessageFor(m => m.RecordTime)
</div>
<div style="text-align:left; width:98%">
<h3>内容</h3>
</div>
<div width:98%">
@Html.TextAreaFor(m => m.RecordInfo, new { @style = "width:600px;Height:400px" })
@Html.ValidationMessageFor(m => m.RecordInfo)
</div>
<p>
<input type="submit" value="保存" name="save"/>
<input type="button" value="取消" onclick="window.close();" />
</p>
}
</div>
</body>
</html>
页面如下:
<div style="width: 98%"> <h3 style="text-align: left; width: 600px; display: inline-block;">时间</h3> </div> <!-- 中間省略 --> <div style="width: 98%"> <h3 style="text-align: left; width: 600px; display: inline-block;">内容</h3> </div>