2015年12月19日 星期六

滑開感覺動作css

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

<style>
.header ul li {
    display: inline;
}
.header ul a {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 30px;
    -webkit-transition: color .25s ease-in-out, width .25s ease-in-out;
    -moz-transition: color .25s ease-in-out, width .25s ease-in-out;
    -ms-transition: color .25s ease-in-out, width .25s ease-in-out;
    -o-transition: color .25s ease-in-out, width .25s ease-in-out;
    transition: color .25s ease-in-out, width .25s ease-in-out;
}
.header ul a.active, .header ul a:hover {
    width: 150px;
}
.header .fa{ width:30px;}
</style>



html 部分

<div class="header">
<ul>
<li><a href="#"><i class="fa fa-anchor"></i><span>投資組合</span></a></li>
<li><a href="#"><i class="fa fa-bell-o"></i><span>下午7時26分</span></a></li>
<li><a href="#"><i class="fa fa-taxi"></i><span>日出</span></a></li>
<li><a href="#"><i class="fa fa-cogs"></i><span>背景</span></a></li>
</ul>
</div>

示意圖


2015年12月1日 星期二

css 分享標籤

Follow us

html

<ul class="redirect-socials">
<li><a class="twitter" href="#"><span>Twitter</span></a></li>
<li><a class="facebook" href="#"><span>Facebook</span></a></li>
<li><a class="google" href="#"><span>Google+</span></a></li>
<li><a class="dribbble" href="#"><span>Dribbble</span></a></li>
<li><a class="rss" href="#"><span>RSS</span></a></li>
</ul>

CSS

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    margin: 0;
    padding: 0;
}
 p {
    margin: 1em 0;
    line-height: 1.4;
    font-family: "Merriweather", georgia, serif;
}
.redirect-socials li {
    display: inline-block;
    margin-right: .4em;
    margin-bottom: .6em;
}
.redirect-socials a {
    font-size: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    padding: .8em 1.2em 1em;
    position: relative;
    -webkit-transition: all 0.2s;
    -moz-transition: all 0.2s;
    transition: all 0.2s;
text-decoration:none;
}
.redirect-socials .twitter {
    color: #50abf1;
    box-shadow: inset 0 -2px 0 #50abf1;
}
.redirect-socials .facebook {
    color: #3b599a;
    box-shadow: inset 0 -2px 0 #3b599a;
}
.redirect-socials .google {
    color: #df4a32;
    box-shadow: inset 0 -2px 0 #df4a32;
}
.redirect-socials .dribbble {
    color: #ec4989;
    box-shadow: inset 0 -2px 0 #ec4989;
}
.redirect-socials .rss {
    color: #e77b39;
    box-shadow: inset 0 -2px 0 #e77b39;
}
.redirect-socials a:hover {
    color: #fff; text-decoration:none;
}
.redirect-socials a span {
    position: relative;
    z-index: 5;
}
.redirect-socials a::before {
    content: '';
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    left: 0;
    bottom: 0;
    display: inline-block;
    -webkit-transform: scale(1, 0);
    -moz-transform: scale(1, 0);
    -ms-transform: scale(1, 0);
    -o-transform: scale(1, 0);
    transform: scale(1, 0);
    -webkit-transform-origin: 50% 100%;
    -moz-transform-origin: 50% 100%;
    -ms-transform-origin: 50% 100%;
    -o-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    -webkit-transition: all 0.2s;
    -moz-transition: all 0.2s;
    transition: all 0.2s;

}
.redirect-socials .twitter::before {
    background: #50abf1;
}
.redirect-socials .facebook::before {
    background: #3b599a;
}
.redirect-socials .google::before {
    background: #df4a32;
}
.redirect-socials .dribbble::before {
    background: #ec4989;
}
.redirect-socials .rss::before {
    background: #e77b39;
}
.redirect-socials a:hover::before {
    -webkit-transform: scale(1, 1);
    -moz-transform: scale(1, 1);
    -ms-transform: scale(1, 1);
    -o-transform: scale(1, 1);
    transform: scale(1, 1);

}