Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 需要将换行文本添加到我的div_Html_Css - Fatal编程技术网

Html 需要将换行文本添加到我的div

Html 需要将换行文本添加到我的div,html,css,Html,Css,大家好,我在文本区域上方有一个div,两个div的宽度相同,当我提交表单时,div变宽了。如何使用word包装保持相同的大小?谢谢 CSS: HTML: 您可以使用CSS属性word wrap。这应该在所有主要浏览器中都能正常工作,根据: 我通过添加以下内容解决了问题: <td width="800px" colspan="4"> 添加此..并扩展div添加..修复了问题 <tr> <td colspan="4"> <

大家好,我在文本区域上方有一个div,两个div的宽度相同,当我提交表单时,div变宽了。如何使用word包装保持相同的大小?谢谢

CSS:

HTML:


您可以使用CSS属性word wrap。这应该在所有主要浏览器中都能正常工作,根据:


我通过添加以下内容解决了问题:

 <td width="800px" colspan="4">

添加此..并扩展div添加..修复了问题
 <tr>
        <td colspan="4">
        <c:if test="${action == 'update'}">
        <%-- Preserve the indentation for this TEXTAREA in order to keep extra whitespace out of it. --%>
        <div class="tarea" name="mcRemarkOld" ><c:forEach var="mcbean" items="${form.mcRemarks}">--- ${mcbean.auditable.lastModifiedBy.firstName} ${mcbean.auditable.lastModifiedBy.lastName}, <fmt:formatDate value="${mcbean.auditable.lastModifiedDate}" pattern="${date_time_pattern}" />

        <br><br>${mcbean.remark} &nbsp;  
        <rbac:check operation="<%=Operation.ADMIN_UPDATE%>">
        <a class="edit_activity" href="show.edit_remarks?remarkId=${mcbean.id}&type=1&hotPartId=${form.hotPartId}"><img class="edit" src="../images/icon_edit.gif" border="0" alt="Edit"/></a>
        </rbac:check>

        <br>
        <br>
        </c:forEach></div><br/>
        </c:if>
            <rbac:check field="<%=Field.HOT_PARTS_SOR_REMARKS%>" display="none">
            <TEXTAREA tabindex="20" name="mcRemark" rows="7" cols="100" scrolling="auto" <c:if test="${not empty lock && !lock.locked && action != 'add'}">disabled="disabled"</c:if>>${form.mcRemark}</TEXTAREA>
            </rbac:check>
        </td>
    </tr>
div.tarea {
  background-color: #DDDDD0;
  font-family: arial, sans-serif;
  font-size: 10pt;
  margin: 0px;
  width: 100%;
  height: 100px; 
  overflow-y:auto;
  border:2px grey solid;
  word-wrap:break-word;
}
div.tarea {
  width: 100%;
  height: 100px; 
  overflow: hidden;
  float:left;
  text-overflow: ellipsis;
}
 <td width="800px" colspan="4">