css实例教程 一款纯css实现的垂直时间线效果

网站建设 2023-01-28 21:38www.1681989.com免费网站

  今天给大家分享一款纯css实现的垂直时间线效果。垂直时间线适合放在类似任务时间安排的网页上。该实现采用了蓝色作为主题色,界面效果还不错。一起看下效果图

  实现的代码。

  html代码


复制代码
代码如下:
<div class="contaer">
<header class="clearfix">
<span>Blueprt <span class="bp-icon bp-icon-about" data-content="The Blueprts are a collection of basic and mimal website concepts, ponents, plugs and layouts with mimal style for easy adaption and usage, or simply for spiration.">
</span></span>
<h1>
Vertical Timele</h1>
<nav>
<a target="_blank" href="http://.<font color="#000000">.jb51.</font>/Article/9250" class="bp-icon bp-icon-prev"
data-fo="previous Blueprt"><span>Previous Blueprt</span></a>
<!--a href="" _fcksavedurl="""" class="bp-icon bp-icon-next" data-fo="next Blueprt"><span>Next Blueprt</span></a-->
<a target="_blank" href="http://.<font color="#000000">.jb51.</font>/Article/9250" class="bp-icon bp-icon-drop"
data-fo="back to the Codrops article"><span>back to the Codrops article</span></a>
<a target="_blank" href="http://.<font color="#000000">.jb51.</font>/Article/9250" class="bp-icon bp-icon-archive"
data-fo="Blueprts archive"><span>Go to the archive</span></a>
</nav>
</header>
<div class="ma">
<ul class="cbp_tmtimele">
<li>
<time class="cbp_tmtime" datetime="2013-04-10 18:30">
<span>4/10/13</span> <span>18:30</span></time>
<div class="cbp_tmicon cbp_tmicon-phone">
</div>
<div class="cbp_tmlabel">
<h2>
Ricebean black-eyed pea</h2>
<p>
Wter purslane courgette pumpk quandong komatsuna fennel green bean cucumber
watercress. Pea sprouts wattle seed rutabaga okra yarrow cress avocado grape radish
bush tomato ricebean black-eyed pea maize eggplant. Cabbage lentil cucumber chickpea
sorrel gram garbanzo planta lotus root bok choy squash cress potato summer purslane
salsify fennel horseradish dulse. Wter purslane garbanzo artichoke brooli lentil
corn okra silver beet celery quandong. Planta salad beetroot bunya nuts black-eyed
pea collard greens radish water spach gourd chicory prairie turnip avocado sierra
leone bologi.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-11T12:04">
<span>4/11/13</span> <span>12:04</span></time>
<div class="cbp_tmicon cbp_tmicon-screen">
</div>
<div class="cbp_tmlabel">
<h2>
Greens radish arugula</h2>
<p>
Caulie dandelion maize lentil collard greens radish arugula sweet pepper water spach
kombu courgette lettuce. Celery coriander bitterleaf epazote radihio shallot wter
purslane collard greens sprg onion squash lentil. Artichoke salad bamboo shoot
black-eyed pea brussels sprout garlic kohlrabi.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-13 05:36">
<span>4/13/13</span> <span>05:36</span></time>
<div class="cbp_tmicon cbp_tmicon-mail">
</div>
<div class="cbp_tmlabel">
<h2>
Sprout garlic kohlrabi</h2>
<p>
Parsnip lotus root celery yarrow seakale tomato collard greens tigernut epazote
ricebean melon tomatillo soybean chicory brooli beet greens peanut salad. Lotus
root burdock bell pepper chickweed shallot groundnut pea sprouts welsh onion wattle
seed pea salsify turnip scallion peanut arugula bamboo shoot onion swiss chard.
Avocado tomato peanut soko amaranth grape fennel chickweed mung bean soybean endive
squash beet greens carrot chicory green bean. Tigernut dandelion sea lettuce garlic
daikon courgette celery maize parsley komatsuna black-eyed pea bell pepper auberge
cauliflower zuhi. Quandong pea chickweed tomatillo quandong cauliflower spach
water spach.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-15 13:15">
<span>4/15/13</span> <span>13:15</span></time>
<div class="cbp_tmicon cbp_tmicon-phone">
</div>
<div class="cbp_tmlabel">
<h2>
Watercress ricebean</h2>
<p>
Peanut gourd nori welsh onion rock melon mustard jícama. Desert rais amaranth
kombu auberge kale seakale brussels sprout pea. Black-eyed pea celtuce bamboo
shoot salad kohlrabi leek squash prairie turnip catsear rock melon chard taro brooli
turnip greens. Fennel quandong potato watercress ricebean swiss chard garbanzo.
Endive daikon brussels sprout lotus root silver beet epazote melon shallot.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-16 21:30">
<span>4/16/13</span> <span>21:30</span></time>
<div class="cbp_tmicon cbp_tmicon-earth">
</div>
<div class="cbp_tmlabel">
<h2>
Courgette daikon</h2>
<p>
Parsley amaranth tigernut silver beet maize fennel spach. Ricebean black-eyed
pea maize scallion green bean spach cabbage jícama bell pepper carrot onion corn
planta garbanzo. Sierra leone bologi komatsuna celery peanut swiss chard silver
beet squash dandelion maize chicory burdock tatsoi dulse radish wakame beetroot.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-17 12:11">
<span>4/17/13</span> <span>12:11</span></time>
<div class="cbp_tmicon cbp_tmicon-screen">
</div>
<div class="cbp_tmlabel">
<h2>
Greens radish arugula</h2>
<p>
Caulie dandelion maize lentil collard greens radish arugula sweet pepper water spach
kombu courgette lettuce. Celery coriander bitterleaf epazote radihio shallot wter
purslane collard greens sprg onion squash lentil. Artichoke salad bamboo shoot
black-eyed pea brussels sprout garlic kohlrabi.</p>
</div>
</li>
<li>
<time class="cbp_tmtime" datetime="2013-04-18 09:56">
<span>4/18/13</span> <span>09:56</span></time>
<div class="cbp_tmicon cbp_tmicon-phone">
</div>
<div class="cbp_tmlabel">
<h2>
Sprout garlic kohlrabi</h2>
<p>
Parsnip lotus root celery yarrow seakale tomato collard greens tigernut epazote
ricebean melon tomatillo soybean chicory brooli beet greens peanut salad. Lotus
root burdock bell pepper chickweed shallot groundnut pea sprouts welsh onion wattle
seed pea salsify turnip scallion peanut arugula bamboo shoot onion swiss chard.
Avocado tomato peanut soko amaranth grape fennel chickweed mung bean soybean endive
squash beet greens carrot chicory green bean. Tigernut dandelion sea lettuce garlic
daikon courgette celery maize parsley komatsuna black-eyed pea bell pepper auberge
cauliflower zuhi. Quandong pea chickweed tomatillo quandong cauliflower spach
water spach.</p>
</div>
</li>
</ul>
</div>
</div>

  css代码


复制代码
代码如下:
, :after, :before
{
-webkit-box-sizg: border-box;
-moz-box-sizg: border-box;
box-sizg: border-box;
}
body, html
{
font-size: 100%;
paddg: 0;
marg: 0;
}

/ Clearfix hack by Nicolas Gallagher: <a href="http://nicolasgallagher./micro-clearfix-hack/">http://nicolasgallagher./micro-clearfix-hack/</a> /
.clearfix:before, .clearfix:after
{
content: " ";
display: table;
}
.clearfix:after
{
clear: both;
}

body
{
font-family: 'Lato' , Calibri, Arial, sans-serif;
color: #47a3da;
}

a
{
color: #f0f0f0;
text-decoration: none;
}

a:hover
{
color: #000;
}

.ma, .contaer > header
{
width: 90%;
max-width: 69em;
marg: 0 auto;
paddg: 0 1.875em 3.125em 1.875em;
}

.contaer > header
{
paddg: 2.875em 1.875em 1.875em;
}

.contaer > header h1
{
font-size: 2.125em;
le-height: 1.3;
marg: 0 0 0.6em 0;
float: left;
font-weight: 400;
}

.contaer > header > span
{
display: block;
position: relative;
z-dex: 9999;
font-weight: 700;
text-transform: uppercase;
letter-spacg: 0.5em;
paddg: 0 0 0.6em 0.1em;
}

.contaer > header > span span:after
{
width: 30px;
height: 30px;
left: -12px;
font-size: 50%;
: -8px;
font-size: 75%;
position: relative;
}

.contaer > header > span span:hover:before
{
content: attr(data-content);
text-transform: none;
text-dent: 0;
letter-spacg: 0;
font-weight: 300;
font-size: 110%;
paddg: 0.8em 1em;
le-height: 1.2;
text-align: left;
left: auto;
marg-left: 4px;
position: absolute;
color: #fff;
background: #47a3da;
}

.contaer > header nav
{
float: right;
text-align: center;
}

.contaer > header nav a
{
display: le-block;
position: relative;
text-align: left;
width: 2.5em;
height: 2.5em;
background: #fff;
border-radius: 50%;
marg: 0 0.1em;
border: 4px solid #47a3da;
}

.contaer > header nav a > span
{
display: none;
}

.contaer > header nav a:hover:before
{
content: attr(data-fo);
color: #47a3da;
position: absolute;
width: 600%;
: 120%;
text-align: right;
right: 0;
poter-events: none;
}

.contaer > header nav a:hover
{
background: #47a3da;
}

.bp-icon:after
{
font-family: 'bpicons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
text-align: center;
color: #47a3da;
-webkit-font-smoothg: antialiased;
}

.contaer > header nav .bp-icon:after
{
position: absolute;
: 0;
left: 0;
width: 100%;
height: 100%;
le-height: 2;
text-dent: 0;
}

.contaer > header nav a:hover:after
{
color: #fff;
}

.bp-icon-next:after
{
content: "\e000";
}
.bp-icon-drop:after
{
content: "\e001";
}
.bp-icon-archive:after
{
content: "\e002";
}
.bp-icon-about:after
{
content: "\e003";
}
.bp-icon-prev:after
{
content: "\e004";
}

@media screen and (max-width: 55em)
{

.contaer > header h1, .contaer > header nav
{
float: none;
}

.contaer > header > span, .contaer > header h1
{
text-align: center;
}

.contaer > header nav
{
marg: 0 auto;
}

.contaer > header > span
{
text-dent: 30px;
}
}

/ COMPONENT.CSS /

/ Made with <a href="http://ioon.io/">http://ioon.io/</a> /

.cbp_tmtimele
{
marg: 30px 0 0 0;
paddg: 0;
list-style: none;
position: relative;
}

/ The le /
.cbp_tmtimele:before
{
content: '';
position: absolute;
: 0;
bottom: 0;
width: 10px;
background: #afdcf8;
left: 20%;
marg-left: -10px;
}

.cbp_tmtimele > li
{
position: relative;
}

/ The date/time /
.cbp_tmtimele > li .cbp_tmtime
{
display: block;
width: 25%;
paddg-right: 100px;
position: absolute;
}

.cbp_tmtimele > li .cbp_tmtime span
{
display: block;
text-align: right;
}

.cbp_tmtimele > li .cbp_tmtime span:first-child
{
font-size: 0.9em;
color: #bdd0db;
}

.cbp_tmtimele > li .cbp_tmtime span:last-child
{
font-size: 2.9em;
color: #3594cb;
}

.cbp_tmtimele > li:nth-child(odd) .cbp_tmtime span:last-child
{
color: #6cbfee;
}

/ Right content /
.cbp_tmtimele > li .cbp_tmlabel
{
marg: 0 0 15px 25%;
background: #3594cb;
color: #fff;
paddg: 2em;
font-size: 1.2em;
font-weight: 300;
le-height: 1.4;
position: relative;
border-radius: 5px;
}

.cbp_tmtimele > li:nth-child(odd) .cbp_tmlabel
{
background: #6cbfee;
}

.cbp_tmtimele > li .cbp_tmlabel h2
{
marg-: 0px;
paddg: 0 0 10px 0;
border-bottom: 1px solid rgba(255,255,255,0.4);
}

/ The triangle /
.cbp_tmtimele > li .cbp_tmlabel:after
{
right: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
poter-events: none;
border-right-color: #3594cb;
border-width: 10px;
: 10px;
}

.cbp_tmtimele > li:nth-child(odd) .cbp_tmlabel:after
{
border-right-color: #6cbfee;
}

/ The icons /
.cbp_tmtimele > li .cbp_tmicon
{
width: 40px;
height: 40px;
font-family: 'ecoico';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
font-size: 1.4em;
le-height: 40px;
-webkit-font-smoothg: antialiased;
position: absolute;
color: #fff;
background: #46a4da;
border-radius: 50%;
box-shadow: 0 0 0 8px #afdcf8;
text-align: center;
left: 20%;
: 0;
marg: 0 0 0 -25px;
}

.cbp_tmicon-phone:before
{
content: "\e000";
}

.cbp_tmicon-screen:before
{
content: "\e001";
}

.cbp_tmicon-mail:before
{
content: "\e002";
}

.cbp_tmicon-earth:before
{
content: "\e003";
}

/ Example Media Queries /
@media screen and (max-width: 65.375em)
{

.cbp_tmtimele > li .cbp_tmtime span:last-child
{
font-size: 1.5em;
}
}

@media screen and (max-width: 47.2em)
{
.cbp_tmtimele:before
{
display: none;
}

.cbp_tmtimele > li .cbp_tmtime
{
width: 100%;
position: relative;
paddg: 0 0 20px 0;
}

.cbp_tmtimele > li .cbp_tmtime span
{
text-align: left;
}

.cbp_tmtimele > li .cbp_tmlabel
{
marg: 0 0 30px 0;
paddg: 1em;
font-weight: 400;
font-size: 95%;
}

.cbp_tmtimele > li .cbp_tmlabel:after
{
right: auto;
left: 20px;
border-right-color: transparent;
border-bottom-color: #3594cb;
: -20px;
}

.cbp_tmtimele > li:nth-child(odd) .cbp_tmlabel:after
{
border-right-color: transparent;
border-bottom-color: #6cbfee;
}

.cbp_tmtimele > li .cbp_tmicon
{
position: relative;
float: right;
left: auto;
marg: -55px 5px 0 0px;
}
}  

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by