私はdivでテーブルレイアウトをシミュレートしており、その中にいくつかのスパンがあります。私はラップするテキストをインデントするために、右側のスパンを望みます。私はいくつかのことを試しましたが、それを働かせることはできません。どんな助けもありがとう。<span>インデントがラップされたテキスト
jsFiddle:http://jsfiddle.net/2Wbuv/
HTML
<div class="display-element">
<span class="display-label">Field 1</span>
<span class="display-field">This is my string of data, some times it is pretty long. Sometimes it is not. This one is.</span>
</div>
<div class="display-element">
<span class="display-label">Field 2</span>
<span class="display-field">This is another string of data.</span>
</div>
CSS
.display-element {}
.display-label {display: inline-block;
width: 100px;
padding-left: 5px;}
.display-field {display: inline;}
なぜ 'display:table-cell'を使わないのですか? – sdleihssirhc
うん、天才...私はそれを前に使ったことがないし、今なぜ私は考えていない。私はあなたにポイントを与えることができるように答えてください。 –
ああ、今は100%幅にすることはできません...それでもやっています。 –