css 常用效果集锦

1、只支持IE的table隔行换色:

    tbody tr {background-color:expression('#ffffff,#f1f9fc'.split(',')[rowIndex%2]);}

 

2、连续字符换行:

    word-wrap:break-word;

 

 

3、两端对齐;文字对齐:

    text-align:justify; text-justify:inter-ideograph;

 

4、兼容浏览器,IE6.0/IE7.0/火狐ff/

   书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面

   第一种方法: background:orange;*background:green !important;*background:blue;

   第二种方法: background:orange;*background:green;_background:blue;

   第三种方法:

    #example { color: #333; } /* ff */
    * html #example { color: #666; } /* IE6 */
    *+html #example { color: #999; } /* IE7 */

 

5、兼容IE/FF的透明滤镜css:
    .test {

        filter:Alpha(Opacity=40);
        -moz-Opacity:.4;
        Opacity:.4;

            }

 

6、div不换行超出隐藏...
    .text-overflow{
         display:block;
         width:31em;
         word-break:keep-all;
         white-space:nowrap;
         overflow:hidden;
         text-overflow:ellipsis;
        }

 

7、表格table不换行超出隐藏...
    table{
         width:30em;
         table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */
        }
    td{
         width:20%;
         word-break:keep-all;
         white-space:nowrap;
         overflow:hidden;
         text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) / 
        }

 

8、支持ie6.0中png图片为透明
    .test {
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader( sizingMethod='crop', src="images/log.png");/*ie6*/
    background:url(../images/navi/btn_login2.png) no-repeat !important;/*ff*/
    background:none;
/*ie6*/

    }

 

9、兼容ff/ie7的最小高度 

    .test {

         height:auto!important;
         height:200px;
         min-height:200px;
        }

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值