0

div をページ全体に水平に表示しようとしていますが、それらの間に自動改行があります。どうすればこれを修正できるのだろうと思っていました。

<div id="box1">
    <header id="whyshouldi">
    What is iOS Development
    </header>
    <p id="whatis">
        iOS Development is the process used to create native applications for iPhone, iPod, and iPad. Applications are made using the SDK(software development kit), Xcode. Aside from the software, it is necessary that iOS Developers know Objective-C.
    </p>
</div>

        <div id="box2">
        <header id="whyshouldi">
    Why Should I learn it?
        </header>
    <p id="whatis">
Learning native app development can allow you to better expand the horizon of knowledge in iPhone, and can make you a better programmer overall. It is a great skill to know no matter who you are.
    </p>
</div>
4

3 に答える 3

0

これは、クラスを導入するか、特定のトリックを使用して、非常に簡単に実現できます。使用すれば、目的display: inline-blockを達成できます。#box1では、理論上は可能だった ID にクラスを導入したとしましょう#box2...

.col { display: inline-block; max-width: 170px; width: 100%; vertical-align: top; } 

#box1クローズ</div>#box2オープニングの間のマークアップのギャップを埋めるためにインラインブロックを使用するときは、常に覚えておいて<div>ください。そうしないと、3 つまたは 4 つの不要なピクセルが残ることになります。

このフィドルを確認してください。これがあなたが求めているものだと思います。http://jsfiddle.net/UsNBj/

于 2013-07-03T19:53:07.160 に答える