Css只有垂直时间轴

Avi*_*ese 6 html javascript css jquery css3

我正在使用css制作垂直时间轴,任何人都可以提供帮助.左边的部分越来越拥挤.左部分指针圆与相反的部分重叠.试图只用css制作它.我们可以添加任何java脚本以使其工作.

http://jsfiddle.net/cdtHx/

码:

    <!DOCTYPE HTML>
<html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style type='text/css'>
.line {
    width:930px;
    margin:0 auto;
}
.line div {
    width: 408px;
    background-color:#ffffff;
    border:solid 1px #B4BBCD;
    min-height:35px;
    text-align:justify;
    word-wrap:break-word;
    list-style:none;
}
.ci {
    position:relative;
    float:right;
}
.cl {
    position: relative;
    text-align:right;
}
.ci, .cl span {
    padding:10px;
}
.line:before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
}
.ci:before, .cl:after, .ci span:before, .cl span:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
}
.line:before {
    width: 3px;
    top: -20px;
    bottom: -20px;
    background:#000;
}
.ci:before {
    width: 5px;
    height: 5px;
    border: 3px solid #CCC;
    border-radius: 100px;
    margin: 10px 0 0 -38px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2), inset 0 1px 1px rgba(0,0,0,0.1);
    background: #000;
}
.ci:hover:before {
    background: #090;
}
.ci span:before {
    top: 12px;
    left: -6px;
    width: 9px;
    height: 9px;
    border-width: 0 0 1px 1px;
    border-style: solid;
    border-color: #e5e5e5;
    background: #fff;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
}
/*gggggg*/
    .cl:after {
    width: 5px;
    height: 5px;
    border: 3px solid #CCC;
    border-radius: 100px;
    margin: 10px 0 0 445px;
    background: #000;
}
.cl:hover:after {
    background: #090;
}
.cl span:after {
    top: 12px;
    left: 404px;
    width: 9px;
    height: 9px;
    border-width: 1px 1px 0 0;
    border-style: solid;
    border-color: #e5e5e5;
    background: #fff;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
}
?
</style>
    </head>

    <body style="overflow:hidden;">
    <div class="line">
      <div class="ci"><span>one</span></div>
      <div class="cl"><span>two</span></div>
      <div class="ci"><span>one</span></div>
      <div class="cl"><span>two</span></div>
      <div class="ci"><span>one</span></div>
      <div class="cl"><span>two</span></div>
    </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Ozz*_*ech 8

在Github上查看我的示例https://gist.github.com/OzzyCzech/6240202

它的垂直时间轴元素位于两侧(左侧和右侧)

在此输入图像描述


pet*_*ete 1

重新定义.ci.cl

\n\n\n\n
.ci {\n    position: relative;\n    float: right;\n    clear: right;/*added*/\n}\n\n.cl {\n    position: relative;\n    /*text-align: right;*//*removed*/\n    float: left;/*added*/\n    clear: left;/*added*/\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

更改line div.cl span:after

\n\n
.line div {\n    width: 396px;/*changed from 408px*/\n    background-color: #ffffff;\n    border: solid 1px #B4BBCD;\n    min-height: 35px;\n    text-align: justify;\n    word-wrap: break-word;\n    list-style: none;\n}\n\n.line:before {\n    width: 2px;/*changed from 3px*/\n    top: -20px;\n    bottom: -20px;\n    background: #000;\n}\n\n.cl span:after {\n    top: 12px;\n    left: 392px;/*changed from 404px*/\n    width: 9px;\n    height: 9px;\n    border-width: 1px 1px 0 0;\n    border-style: solid;\n    border-color: #e5e5e5;\n    background: #fff;\n    -webkit-transform: rotate(45deg);\n    -moz-transform: rotate(45deg);\n    -ms-transform: rotate(45deg);\n    -o-transform: rotate(45deg);\n}\xe2\x80\x8b\n
Run Code Online (Sandbox Code Playgroud)\n\n

更新的小提琴: http: //jsfiddle.net/cdtHx/1/

\n\n

这就是您要找的吗?

\n