两个div在同一行

时间:2013-09-21 22:04:25

标签: html css

我有一个包含一些文字的框和另一个包含视频的框 这是jsfiddle
代码:
CSS:

.bluebox{
    background-color: #1EAECE;
}
.orangebox{
    background-color: #FF8800;
}

HTML:

<div style="margin-top: -13px;">
<div class="bluebox" style="display: table-cell;width: 52.2%;">
    <div class="title">Usage</div>
    <ul>
        <li>Moisten with warm water to activate the ingredients.</li>
        <li>Apply the bar directly on face & body.</li>
        <li>Massage the creamy texture into your skin.</li>
        <li>Allow the emulsion time to permeate into the skin.</li>
        <li>Rinse off.</li>
    </ul>
    <p>Suitable for Face wash, Body wash, Shaving, Sensitive areas, Intimate parts, Shower & Bath.</p>
</div>
<div style="display: table-cell;width: 0.7%;"></div>
<div class="orangebox" style="display: table-cell;width: 47.3%;">
    <video width="418" src="http://brexes.com/Images%20and%20Videos/GamilaSecretVideo.mp4" controls></video>
</div>
</div>

包含文本的第一个框顶部有一个巨大的空间,我想删除这个空格并在同一行中设置两个div。 所以这是它的样子: enter image description here

以下是它应该是这样的: enter image description here

1 个答案:

答案 0 :(得分:3)

添加基本:

vertical-align: top;

到您的班级“.bluebox”

相关问题