2011-11-23 53 views
0

你好傢伙我有一個文本區上面的div,他們都是相同的寬度,當我提交我的表單div擴大了。我怎樣才能保持與文字包裝相同的大小?謝謝?需要添加包裝文本到我的div

enter image description here

CSS:

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; 
} 

HTML:

<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> 
+0

加入 ....固定的問題 –

回答

0

您可以使用CSS屬性,word-wrap。這應該適用於所有主流瀏覽器:http://www.w3schools.com/cssref/css3_pr_word-wrap.asp

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; 
} 
0
div.tarea { 
    width: 100%; 
    height: 100px; 
    overflow: hidden; 
    float:left; 
    text-overflow: ellipsis; 
} 
+0

加入this..and該div擴大 –

0

我通過添加解決了這個問題:

<td width="800px" colspan="4"> 
相關問題