IE6 中的透明 PNG
这修复了 IE6 中的 PNG 透明度。将背景设置为非并将图像包含在过滤器中。不需要任何 javascript 或 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');
}
在元素之后设置分页行为 - 跨浏览器
table {
page-break-after:always
}
您可以始终使用属性,避免、自动、左、右、固有。在http://www.w3schools.com/CSS/pr_print_pageba.asp阅读文档
一种使用“Section 1”、“1.1”、“1.2”等对部分和子部分进行编号的方法 - 跨浏览器
h2:before
{
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
http://www.w3schools.com/CSS/pr_gen_counter-increment.asp
将表格边框折叠成单个边框或像标准 HTML 一样分离 - 跨浏览器
table
{
border-collapse:collapse;
}
http://www.w3schools.com/css/pr_tab_border-collapse.asp
从按钮或输入字段中删除选择边框或虚线。还有其他很棒的用途 - 跨浏览器
button{
outline:0;
}
http://www.w3schools.com/CSS/pr_outline.asp
* 用于 IE6 中 100% 高度的 html
* html .move{
height:100%;
}
允许长单词中断并换行到下一行 - CSS3跨浏览器
.whatever {
word-wrap:break-word;
}
http://www.w3schools.com/css3/css3_pr_word-wrap.asp
速记
前
font-size: 1em;
line-height: 1.5em;
font-weight: bold;
font-style: italic;
font-family: serif
后
font: 1em/1.5em bold italic serif;
前
background-color: #fff;
background-image: url(image.gif);
background-repeat: no-repeat;
background-position: top left;
后
background: #fff url(image.gif) no-repeat top left;
前
list-style: #fff;
list-style-type: disc;
list-style-position: outside;
list-style-image: url(image.gif)
后
list-style: disc outside url(something.gif);
前
margin-top: 2px;
margin-right: 1px;
margin-bottom: 3px;
margin-left: 4px
后
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 ;