时光轴代码

KuaiKan 1月前 83

HTML效果

2020

2019

CSS代码

<style type="text/css">
.point-time {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  top: 17px;
  left: 20%;
  background: #1c87bf;
  margin-left: -4px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #fff;
}

.text-red {
  color: #f6393f;
}

.text-blue {
  color: #1c87bf;
}

.text-green {
  color: #95c91e;
}

.text-yellow {
  color: #ffb902;
}

.text-purple {
  color: #d32d93;
}

.point-red {
  background-color: #f6393f;
}

.point-blue {
  background-color: #1c87bf;
}

.point-green {
  background-color: #95c91e;
}

.point-yellow {
  background-color: #ffb902;
}

.point-purple {
  background-color: #d32d93;
}
.content article {
  position: relative;
}
.content article > h3 {
  width: 15%;
  height: 20px;
  line-height: 20px;
  text-align: right;
  font-size: 1.4em;
  color: #1d1d1d;
  padding: 10px 0 20px;
}
.content article section {
  padding: 0 0 17px;
  position: relative;
}
.content article section:before {
  content: "";
  width: 5px;
  top: 17px;
  bottom: -17px;
  left: 20%;
  background: #e6e6e6;
  position: absolute;
}
.content article section:last-child:before {
  display: none;
}
.content article section time {
  width: 15%;
  display: block;
  position: absolute;
}
.content article section time > span {
  display: block;
  text-align: right;
}
.content article section aside {
  color: #3a3a38;
  margin-left: 25%;
  padding-bottom: 15px;
}
.content article section .brief {
  color: #9f9f9f;
}
</style>

HTML代码

<div class="content">
    <article>
        <h3>2020</h3>
        <section>
            <span class="point-time point-yellow"></span>
            <time datetime="2020-10">
                <span>十月</span>
                <span>2020</span>
            </time>
            <aside>
                <p class="things">天气冷了,记得多穿点衣服!</p>
                <p class="brief">
                    <span class="text-yellow">远方的你</span>(I LOVE YOU)
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-red"></span>
            <time datetime="2020-09">
                <span>三月</span>
                <span>2020</span>
            </time>
            <aside>
                <p class="things">您在 Twitter 上达到了 500 位关注者</p>
                <p class="brief">
                    <span class="text-red">社会形象 </span>
                </p>
            </aside>
        </section>
    </article>
    <article>
        <h3>2019</h3>
        <section>
            <span class="point-time point-green"></span>
            <time datetime="2019-12">
                <span>十二月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">Maketing Live 2012 参观者</p>
                <p class="brief">
                    <span class="text-green">会议</span>
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-green"></span>
            <time datetime="2019-11">
                <span>十一月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">Daily web 2019的访客</p>
                <p class="brief">
                    <span class="text-green">会议</span>
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-red"></span>
            <time datetime="2019-09">
                <span>九月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">您在 Dribbble 上达到了 500 位关注者</p>
                <p class="brief">
                    <span class="text-red">社会形象</span>
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-blue"></span>
            <time datetime="2019-08">
                <span>八月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">Fantasy Interactive 高级设计师的新职位</p>
                <p class="brief">
                    <span class="text-blue">工作经验</span>
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-red"></span>
            <time datetime="2019-03">
                <span>三月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">ASMO 会议发言人</p>
                <p class="brief">
                    <span class="text-red">会议</span>
                </p>
            </aside>
        </section>
        <section>
            <span class="point-time point-blue"></span>
            <time datetime="2019-02">
                <span>二月</span>
                <span>2019</span>
            </time>
            <aside>
                <p class="things">您为 Fantasy Interactive 的初级设计师职位添加了新技能</p>
                <p class="brief">
                    <span class="text-blue">工作经验</span>
                </p>
            </aside>
        </section>
    </article>
</div>


最新回复 (0)
返回