写css遇到的问题

标签的伪类样式

  • a:link: 未访问链接
  • a:visited: 已访问链接
  • a:focus: 正在访问的链接
  • a:active: 激活时(链接获得焦点时)链接的颜色
  • a:hover: 鼠标移到链接上时

文字溢出省略

.flatpages-articles-col-left > ul > li > a {
    color: #3492e9;
    line-height: 50px;
    font-size: 16px;
    width: 300px;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

文章内滚动

.flatpages-articles-col-right {
    border-left: 1px solid #d2d2d2;
    height: 500px;
    overflow: scroll;
}

阴影

.flatpages-articles-title {
    width: 1004px;
    height: 60px;
    background: #0197f3;
    position: relative;
    margin-left: -28px;
    margin-top: 26px;
    -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
    -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
}

三角

.flatpages-articles-title:before {
    width: 0;
    height: 0;
    border-top: 12px solid #3492e9;
    border-left: 12px solid transparent;
    content: '';
    top: 60px;
    position: absolute;
}

透明蒙板

.flatpages-join-mask {
    height: 710px;
    width: 980px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding-top: 42px;
}

适配IE8,IE8中内容不透明,蒙板透明,记得在内容中加上position: relative

.flatpages-about-mask {
    background: #fff;
    background-color: rgba(255, 255, 255, 0.6);
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60)";
    color: #fff;
    border-radius: 20px;
    -moz-border-radius: 20px;
    -webkit-border-radius: 20px;
    padding: 40px 60px;
    height: 600px;
    margin-top: 20px;
}

伪元素下划线

.flatpages-join-info > span:before {
    content: " ";
    position: absolute;
    width: 360px;
    height: 1px;
    background-color: #d2d2d2;
    bottom: 0;
    left: 10px;
}
.flatpages-join-info > span:after {
    content: " ";
    position: absolute;
    bottom: 0;
    left: 10px;
    width: 100px;
    height: 1px;
    background-color: #00a1ea;
}

各种图形

图片灰度切换

例子 http://insights.thoughtworkers.org/frontend-backend/

img.gray {
    -webkit-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: gray;
    filter: grayscale(100%);
    -webkit-transition: all 0.6s;
    -moz-transition: all 0.6s;
    -ms-transition: all 0.6s;
    -o-transition: all 0.6s;
    transition: all 0.6s;
}
如果我的文章对你有很大帮助 那么不妨?
0%