2016-03-31 12 views
0

div表示内の要素の幅を表として固定するのに問題があり、この問題の原因となるキャプションを認識しました。例である:ここでdiv表示内の要素の幅を表として固定する

はコードです:

.row { 
 
    display:table; 
 
    border-spacing:10px; 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
.row-element { 
 
    display: table-cell; 
 
} 
 
.row-element input{ 
 
    width:100%; 
 
    line-height:20px; 
 
} 
 
.row-element label{ 
 
font-family: Arial, Helvetica, sans-serif; 
 
font-size: 12px; 
 
font-weight: bold; 
 
color: #2E2F3F; 
 
display: table-caption; 
 
white-space: nowrap; 
 
    width:100%; 
 
    box-sizing:border-box; 
 
}
<div class="row"> 
 
    <div class="row-element"> 
 
    <label>Name#<span class="mandatory"> *</span></label> 
 
\t <input data="true" type="text" class="textfield error" title="Name" minlength="5" maxlength="15" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t \t \t \t \t </div> 
 
\t \t \t \t \t <div class="row-element"><label>Outside Label &gt; <span class="mandatory"> *</span></label> 
 
\t \t \t \t \t 
 
\t \t \t \t \t <input data="true" type="text" class="textfield error" minlength="5" maxlength="15" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t \t \t \t \t </div> 
 
<div class="row-element"> 
 
    <label>custom_mandatory text#<span class="mandatory"> (Please Specify)</span></label> 
 
    <input data="true" type="text" class="textfield error" mandatory-text="(Please Specify)" title="custom mandatory text" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t </div> \t \t \t \t \t 
 
</div>

+0

私の例である:あなたが私の最初のコメントで述べたリンクを開く場合http://codepen.io/pen/vGeBKN – arefedrees

+0

それは望ましい結果 – bumpy

+0

が何であるかは明らかではありません、あなたは入力が同じではないことがわかります、すべての要素の音楽は同じ幅を持っています、これは不規則な問題です – arefedrees

答えて

0

はあなたが後にしている何本か?私はをrowに追加し、任意の幅をrow-elementに追加しました。ここ

.row { 
 
    display:table; 
 
    border-spacing:10px; 
 
    width: 100%; 
 
    height: 100%; 
 
    table-layout: fixed; 
 
} 
 

 
.row-element { 
 
    display: table-cell; 
 
    width: 100px; 
 
} 
 
.row-element input{ 
 
    width:100%; 
 
    line-height:20px; 
 
} 
 
.row-element label{ 
 
font-family: Arial, Helvetica, sans-serif; 
 
font-size: 12px; 
 
font-weight: bold; 
 
color: #2E2F3F; 
 
display: table-caption; 
 
white-space: nowrap; 
 
    width:100%; 
 
    box-sizing:border-box; 
 
}
<div class="row"> 
 
    <div class="row-element"> 
 
    <label>Name#<span class="mandatory"> *</span></label> 
 
\t <input data="true" type="text" class="textfield error" title="Name" minlength="5" maxlength="15" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t \t \t \t \t </div> 
 
\t \t \t \t \t <div class="row-element"><label>Outside Label &gt; <span class="mandatory"> *</span></label> 
 
\t \t \t \t \t 
 
\t \t \t \t \t <input data="true" type="text" class="textfield error" minlength="5" maxlength="15" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t \t \t \t \t </div> 
 
<div class="row-element"> 
 
    <label>custom_mandatory text#<span class="mandatory"> (Please Specify)</span></label> 
 
    <input data="true" type="text" class="textfield error" mandatory-text="(Please Specify)" title="custom mandatory text" message="Insert Your Name !" name="NAME_FIELD" mandatory=""> 
 
\t </div> \t \t \t \t \t 
 
</div>

+0

うわー、その完全に動作している:Dは、 – arefedrees

関連する問題