zoukankan      html  css  js  c++  java
  • 记录不常用的css效果

    1.清除浮动:

    .clearfloat:after{display:block;clear:both;content:"";visibility:hidden;height:0}
    .clearfloat{zoom:1;}


    2.设置背景透明,字体不透明:

    background:rgba(221,172,106,0.6) none repeat scroll !important; filter:Alpha(opacity=60)


    3.三角形箭头

    /*向上箭头,类似A,只有三个边,不能指定上边框*/
    .arrow-up { 0px; height: 0px; border-left: 30px solid transparent; border-right: 30px solid transparent; border-bottom: 30px solid yellow; /*以下属性可以是IE5兼容*/ font-size: 0px; line-height: 0px; } 
    /*向下箭头 ,类似 V*/
    .arrow-down { 0px; height: 0px; border-left: 30px solid transparent; border-right: 30px solid transparent; border-top: 30px solid blue; font-size: 0px; line-height: 0px; } /*向左的箭头:只有三个边:上,下,右。而<|总体来看,向左三角形的高=上+下边框的长度。宽=右边框的长度*/
    div.arrow-left { 0px; height: 0px; border-bottom: 30px solid transparent; border-top: 30px solid transparent; border-right: 40px solid green; font-size: 0px; line-height: 0px; } /*向右的箭头:只有三个边:上,下,左。而|>总体来看,向右三角形的高=上+下边框的长度。宽=左边框的长度*/
    div.arrow-right { 0px; height: 0px; border-top: 30px solid transparent; border-bottom: 30px solid transparent; border-left: 60px solid black; font-size: 0px; line-height: 0px; }


    4.图片垂直居中

    4.1外部div的css:
    dvi{ 100%; height:100%; line-height:100%; text-align:center; }
    div img{ vertical-align: middle; }
    4.2
    div{border:1px #ddd solid;208px;height:148px;overflow:hidden;text-align:center;display:table;float:left;margin:50px;position:relative;}
    div span{display:table-cell;vertical-align:middle;}
    div span img{border:1px #ddd solid;margin:0 auto;max-200px;max-height:140px;}


    5.字与字之间的间隔

    .div{ letter-spacing:2px; }


    6.textarea禁止拉伸

    textarea{ resize:none;}


    7.首行缩进

    p{ text-indent:0; }


    8.
    超过一行用省略号

    p{ 1000px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }


    超过两行用省略号

    p{ 
        100%;
        word-break: break-all;
        text-overflow: ellipsis;
        display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
        -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
        -webkit-line-clamp: 2; /** 显示的行数 **/
        overflow: hidden; 
    }


    9.ios系统中按钮样式清除:

    .btn{ -webkit-appearance : none ; }

    11.英文字母大小写

    text-transform:capitalize; //首字母大写
    uppercase; //全大写
    lowercase; //全小写

    12.table外边框颜色

    table{
       100%;
      margin-top: 40px;
      border-color:#eeeeee;
      border: solid thin #eeeeee;
    }

    13.图片变灰

    .gray { 
      -webkit-filter: grayscale(100%);
      -moz-filter: grayscale(100%);
      -ms-filter: grayscale(100%);
      -o-filter: grayscale(100%);
      filter: grayscale(100%);
      filter: gray;
    }

    14.数字太长 不会自动换行怎么办

    p{
        word-break:break-all;
    }

    15.placeholder字体颜色

    input::-webkit-input-placeholder {
      color: #333;
    }

    16.css3渐变

    transition-duration: 0.5s;
    -webkit-transition-duration: 0.5s;
    -ms-transition-duration: 0.5s;
    -o-transition-duration: 0.5s;
    transition-property: opacity;
    -webkit-transition-property: opacity;
    -ms-transition-property: opacity;
    -o-transition-property: opacity;
  • 相关阅读:
    WPF框架MVVM简单例子
    向WPF的Grid里面增加控件
    静态资源(StaticResource)和动态资源(DynamicResource)
    WPF中INotifyPropertyChanged用法与数据绑定
    wpf 绑定数据无法更新ui控件可能存在的问题
    C#调用Resources.resx资源文件中的资源
    C# 委托的理解
    Codeforces 524E Rooks and Rectangles 线段树
    Codeforces 1000F One Occurrence 主席树|| 离线+线段树
    GYM 101673 A
  • 原文地址:https://www.cnblogs.com/wylj/p/9473624.html
Copyright © 2011-2022 走看看