hidden css,Hidden features of CSS - Stack Overflow

Transparent PNG in IE6

This fixes PNG transparency in IE6. Set background to non and include the image in filter. No need for any javascript or htc.

.whatever {

background: none; /* Hide the current background image so you can replace it with the filter*/

width: 500px; /* Must specify width */

height: 176px; /* Must specify height */

filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='vehicles.png');

}

Sets page-breaking behavior after an element - Cross browser

table {

page-break-after:always

}

You can use the properties always, avoid, auto, left, right, inherent. Read docs at http://www.w3schools.com/CSS/pr_print_pageba.asp

A way to number sections and sub-sections with "Section 1", "1.1", "1.2", etc - Cross browser

h2:before

{

counter-increment:subsection;

content:counter(section) "." counter(subsection) " ";

}

Collapse Table borders into a single border or detached as in standard HTML - Cross browser

table

{

border-collapse:collapse;

}

Remove selection Border or dotted line from button or input fields. Has other great uses - Cross browser

button{

outline:0;

}

* html for 100% height in IE6

* html .move{

height:100%;

}

Allow long words to break and wrap onto the next line - CSS3 Cross browser

.whatever {

word-wrap:break-word;

}

Shorthands

Before

font-size: 1em;

line-height: 1.5em;

font-weight: bold;

font-style: italic;

font-family: serif

After

font: 1em/1.5em bold italic serif;

Before

background-color: #fff;

background-image: url(image.gif);

background-repeat: no-repeat;

background-position: top left;

After

background: #fff url(image.gif) no-repeat top left;

Before

list-style: #fff;

list-style-type: disc;

list-style-position: outside;

list-style-image: url(image.gif)

After

list-style: disc outside url(something.gif);

Before

margin-top: 2px;

margin-right: 1px;

margin-bottom: 3px;

margin-left: 4px

After

margin:2px 1px 3px 4px; /*also works for padding*/

margin:0; /*You can also do this for all 0 borders*/

margin:2px 3px 5px; /* you can do this for top 2px, left/right 3px, bottom 5px and ;

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值