简体   繁体   English

Facebook时间轴样式CSS / HTML

[英]Facebook Timeline style css/html

I have a problem I can not rearrange the boxes one below the other and there is a distance between them can you help me. 我有一个问题,我无法将这些框重新排列在另一个框的下面,并且它们之间有一段距离可以帮助我。 The boxes have a gap meanings are arranged in one row and not one below the other as I have. 这些盒子之间有空隙,意思是排列成一排,而不是像我这样排成一排。

time, .time {
    font-size: 10px;
    color:gray;
    border-bottom: 1px solid #E7EBF2;
    min-width:350px;
    height:20px;
    padding-bottom: 5px;
}
#timeline {
    width:846px;
    list-style:none;
    list-style-type: none;
    background: url('../imgs/timeline.png') top center repeat-y;
    margin: 0 auto;
    padding:20px;
    margin-bottom:10px;
}
#timeline li {
    width:390px;
    -moz-border-radius:2px;
    border-radius:2px;
    webkit-border-radius:2px;
    border:1px solid #c3ccdf;
    padding:5px;
    background-color:#FFF;
}
#timeline li:nth-of-type(odd) {
    clear: both;
    float:right;
}
#timeline li:nth-of-type(odd), #timeline li:nth-of-type(even) {
    margin:-10px 0 20px 0;
}
#timeline li:nth-of-type(even) .corner {
    position:absolute;
    display:block;
    margin-left:383px;
    width:20px;
    height:15px;
    background:url('../imgs/right.png');
}
#timeline li:nth-of-type(odd) .corner {
    position:absolute;
    display:block;
    margin-left:-25px;
    width:20px;
    height:15px;
    background:url('../imgs/left.png');
}

Here is demo 这是演示 http://jsfiddle.net/jT5e9/1/ http://jsfiddle.net/jT5e9/1/

That's because you had clear: both; 那是因为你很clear: both; in here: 在这里:

#timeline li:nth-of-type(odd) {
    clear: both;
    float:right;
}

Plus I've added float:left to #timeline li and it worked for me. 另外,我在#timeline li添加了float:left#timeline li#timeline li http://jsfiddle.net/jT5e9/2/ http://jsfiddle.net/jT5e9/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM