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) " ";
}
http://www.w3schools.com/CSS/pr_gen_counter-increment.asp
Collapse Table borders into a single border or detached as in standard HTML - Cross browser
table
{
border-collapse:collapse;
}
http://www.w3schools.com/css/pr_tab_border-collapse.asp
Remove selection Border or dotted line from button or input fields. Has other great uses - Cross browser
button{
outline:0;
}
http://www.w3schools.com/CSS/pr_outline.asp
* 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;
}
http://www.w3schools.com/css3/css3_pr_word-wrap.asp
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 ;