기본적으로 2 개의 열이있는 양식 (스크린 샷 : http://mason.gmu.edu/~vnguyenl/form.jpg)을 만들고 있습니다. 레이블 열과 입력 열입니다. 라벨면은 자체 bg 색상을 가진 div에 있고 입력 필드면과 동일합니다. 한면에 많은 텍스트가있는 경우 다른 열보다 높이가 일치하도록 텍스트를 만들려고합니다. 지금은 한쪽이 다른 쪽보다 크면 틈이 있습니다. 어떤 도움을 주셔서 감사합니다! 감사.내부 div를 만드는 CSS가 외부 div 높이와 일치합니다
양식의 HTML처럼 보이는 다음
<div class="formRow">
<div class="labelColumn">Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: Last Name: <span class="required">*</span></div>
<div class="contentcolumn">
<input class="textBox300" type="text" id="last_name" tabindex="1" />
</div>
</div>
는 CSS를는 다음과 같다
#pt-profile-form .labelColumn, .labelColumn2 {
font-weight:bold;
float:left;
width:300px; /* Width of left column */
margin-left:0px;
background:#f0f4f7;
text-align:left;
padding:5px;
padding-left:14px;
display:block;
white-space:normal;
position:relative;
clear:both;
}
#pt-profile-form .formRow { clear:both; height:100%; }
#pt-profile-form .contentcolumn, .contentcolumn2 {
margin-left:320px; /* Set left margin to LeftColumnWidth */
background-color:#eae9d7;
padding:5px;
text-align:left;
vertical-align:middle;
position:relative;
}
#pt-profile-form .labelColumn, .contentcolumn {
/*height:30px;*/
min-height:30px;
height:100%;
}
#pt-profile-form .labelColumn2, .contentcolumn2 { /* column properties for <textarea> */
/*height:100px;*/
height:100%;
}
체크 아웃 : http://www.quirksmode.org/ css/clearing.html –
이것도 역시 : http://www.alistapart.com/articles/prettyaccessibleforms –