4

td 内に 2 つのラベルがあり、アライメントを機能させようとしています

出来ますか ?

これは、同じ説明の問題と必要な方法についてのフィドルです。

jsフィドル

 <tr>
        <td><label >Some Label Test:</label><label>Some Label Test:</label></td>
    <td>
        <label >Some Label Test:</label>
        <label >here is the long test which exceeds the width and comes to second line but i want it like it should start below after test: instaead from some</label></td>
 </tr>

長さが長い場合は、次の行に来て、2 番目のラベルが開始された場所から始まる 2 番目のラベルを探しています。

4

2 に答える 2

1

これは、必要なものを取得する方法の簡単な div の使用法です。http://jsfiddle.net/KHAJz/3/

HTML

<div class="container">
    <div class="first">Some Label Test:</div>
    <div class="first">Some Label Test:</div>
    <div class="first">Some Label Test:</div>
    <div class="text">here is the long test which exceeds the width and comes to second line but i want it like it should start below after test: instead </div>
</div>

CSS

.container{
    width:700px;
    height:60px;
    display:inline-block;

}

.first{
    width:60px;
    height:60px;
    display:inline-block;
    float:left;
}
.text{
    width:300px;
    display:inline-block;
    float:left;
}

テーブルや div があちこちに移動しないように、すべてをまとめて保持するコンテナーを作成します。

于 2013-09-20T11:59:36.067 に答える
0

DOM を変更したくない (または変更できない) 場合は、これをCSSに追加するだけです

label
{
    display: inline-block;
    height: 100%;
}

この作業フィドルを参照してください

ただし、DOM を変更できる場合は、Table レイアウトをそのままにして、divs でレイアウトを再構築することをお勧めします。-キースの答えのように。

于 2013-09-20T12:32:21.423 に答える