0

ピン要素とタイムライン要素を水平の白い線で接続しようとしています。javascriptとcssを使用してこれを行う方法を知っている人はいますか? 以下の参照リンクを参照してください。

前もって感謝します。

  • マイク

http://mikedemar.com/devresources/timeline/example.png

http://mikedemar.com/devresources/timeline/index.html

4

1 に答える 1

2

でコンテナにマーカーを配置し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%;
}

これがフィドルです:http://jsfiddle.net/AAPSg/

于 2012-09-04T16:43:14.990 に答える