我试图在这里制作类似于Facebook时间线的东西,但由于某种原因我无法得到它。为什么我的右侧div仅在第一次离开之后才跟随。我想让他们从同一个地方开始,就像facebook时间线一样。
我为你做了一个小提琴,所以你可以理解我的问题:http://jsfiddle.net/FHR3q/
此外,在它们之间添加某种分隔符的最佳方法是什么,如线。
答案 0 :(得分:3)
像这样写:
<div class="block leftt"></div>
<div class="block right"></div>
<div class="block left"></div>
<div class="block right"></div>
检查此http://jsfiddle.net/FHR3q/6/
<强>已更新强>
您可以使用 nth-child 属性:
答案 1 :(得分:0)
答案 2 :(得分:0)
如果更改顺序,则在
中显示html div<div class="content">
<div class="timeline">
<div class="block left">
<h1>Hello, my name is Steve1.</h1><br />
<h2>Hello, my name is Steve.</h2><br />
<h3>Hello, my name is Steve.</h3><br />
<h4>Hello, my name is Steve.</h4><br />
<h5>Hello, my name is Steve.</h5><br />
<h6>Hello, my name is Steve.</h6>
</div>
<div class="block right">
<h1>Hello, my name is Steve3.</h1><br />
<h2>Hello, my name is Steve.</h2><br />
<h3>Hello, my name is Steve.</h3><br />
<h4>Hello, my name is Steve.</h4><br />
<h5>Hello, my name is Steve.</h5><br />
<h6>Hello, my name is Steve.</h6>
</div>
<div class="block left">
<h1>Hello, my name is Steve2.</h1><br />
<h2>Hello, my name is Steve.</h2><br />
<h3>Hello, my name is Steve.</h3><br />
<h4>Hello, my name is Steve.</h4><br />
<h5>Hello, my name is Steve.</h5><br />
<h6>Hello, my name is Steve.</h6>
</div>
<div class="block right">
<h1>Hello, my name is Steve4.</h1><br />
<h2>Hello, my name is Steve.</h2><br />
<h3>Hello, my name is Steve.</h3><br />
<h4>Hello, my name is Steve.</h4><br />
<h5>Hello, my name is Steve.</h5><br />
<h6>Hello, my name is Steve.</h6>
</div>
</div>