我正在尝试用水平白线连接图钉元素和时间轴元素。有谁知道如何使用 javascript 和 css 来做到这一点?请参阅下面的引用链接。
提前致谢。
- 迈克
最佳答案
将标记放在一个带有overflow: hidden
的容器中,并使用伪元素绘制线条:
HTML:
<ul>
<li class="handleicon"></li>
<li class="handleicon"></li>
<li class="handleicon"></li>
</ul>
CSS:
ul {
position: relative;
overflow: hidden;
height: 260px;
}
.handleicon {
position: absolute;
width: 33px;
height: 50px;
background: url(images/handlered.png);
}
.handleicon:before {
content: '';
width: 1px;
height: 400px;
background: #fff;
position: absolute;
top: 100%;
left: 50%;
}
这是 fiddle :http://jsfiddle.net/AAPSg/
关于javascript - 用线连接元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12267846/