很难解释我的问题是什么,我试着在谷歌上搜索这个问题。我找不到有同样问题的人。我想把我的div安排成Google有记事本的样子。所有的div都应该在彼此之间和旁边,不能只有边距。为了理解我的意思,我在JSFiddle中发布了一个图片(我无权在这里发布图片)。

.col {
    display: inline;
    width: 200px;
    border: 1px solid red;
    margin: 5px;
    vertical-align: top;
}

<div class="col">Some content...</div>
<div class="col">Some content...</div>
<div class="col">Some content...</div>
<div class="col">Some content...</div>
<div class="col">Some content...</div>

http://jsfiddle.net/5t6tm/14/

最佳答案

.col {
display: inline-block;
width: 200px;
border: 1px solid red;
margin: 5px;
vertical-align: top;
float: left;
}



    <div class="col">Some content... Some content... Some content... Some content... Some content... Some content... Some content... Some content... Some content... Some content... Some content... Some content...</div>
<div class="col">Some content... Some content... Some content... Some content...</div>
<div class="col">Some content... Some content... Some content... Some content...</div>
<div class="col">Some content...</div>
<div class="col">Some content... Some content... Some content...</div>
<div class="col">Some content... Some content... Some content...</div>
<div class="col">Some content... Some content... Some content...</div>

关于css - 潜水员彼此相邻,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23238878/

10-12 15:18