2

私はこのコードを持っています:

<div style="margin-top: 5px"></div>
<div style="width:175px; height: 25px; margin: 0 auto; background-color:#fff;">
    <div style="font-weight: bold; text-align: center; width: 175px; height: 50px; margin:0; font-family: 'Droid Sans', sans-serif; color:#666666; font-size:12px; border:0; height:100%; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
        Top 5 Números Sorteados
    </div>
</div>
<center>
<div style="margin-top: 1.5px"></div>
<div style="display:inline-block; width:55px; height: 100%; background-color:#fff; ">
    <div style="font-weight: bold; text-align: center; width: 55px; height: 100%; font-family: 'Droid Sans', sans-serif; color:#666666; font-size:12px; height:100%; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
        <p>1.</p>
        <p>2.</p>
        <p>3.</p>
        <p>4.</p>
        <p>5.</p>
    </div>
</div>
<div style="display:inline-block; width:56px; height: 100%; background-color:#fff; ">
    <div style="font-weight: bold; text-align: center; width: 56px; height: 100%; font-family: 'Droid Sans', sans-serif; color:#666666; font-size:12px; height:100%; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
        <p>1.</p>
        <p>2.</p>
        <p>3.</p>
        <p>4.</p>
        <p>5.</p>
    </div>
</div>
<div style="display:inline-block; width:55px; height: 100%; background-color:#fff; ">
    <div style="font-weight: bold; text-align: center; width: 55px; height: 100%; font-family: 'Droid Sans', sans-serif; color:#666666; font-size:12px; height:100%; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
        <p>1.</p>
        <p>2.</p>
        <p>3.</p>
        <p>4.</p>
        <p>5.</p>
    </div>
</div>
</center>

これにより、次の出力が得られます: http://jsfiddle.net/VmBR7/

そのような境界線なしでインラインの 3 つの div を作成する方法を知りたいです。スタイル オプションを探していますが、それを生成できるものは見つかりません。ありがとう

4

1 に答える 1

4

インライン ブロック要素は、境界線でレンダリングされます。これはここで見つけることができます

必要なものを達成するために、要素inline-blockから表示プロパティを削除し、代わりにそれらを作成しましたdivfloat:left

次に、そこにあるすべての下部要素を、上部要素と同様のスタイリングを使用するdiv親にラップしましたdivdiv

インライン スタイルを使用することもお勧めできません。いくつかリファクタリングしました。

ここにJSFIDDLEがあります

于 2013-04-02T18:20:41.747 に答える