Skip to content

Instantly share code, notes, and snippets.

@beiyuu
Created March 14, 2012 04:01
Show Gist options
  • Save beiyuu/2033965 to your computer and use it in GitHub Desktop.
Save beiyuu/2033965 to your computer and use it in GitHub Desktop.
CSS:Tricks
/************** inline-block ********************/
li {
width: 200px;
min-height: 250px;
border: 1px solid #000;
display: -moz-inline-stack;
display: inline-block;
vertical-align: top;
margin: 5px;
zoom: 1;
*display: inline;
_height: 250px;
}
/************** clearfix ********************/
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden
}
.clearfix {
zoom: 1;
display:
inline-block;
_height: 1px
}
*html .clearfix {
height: 1%;
}
.clearfix {
display: block;
}
/************** triangle ********************/
/*css实现三角形的原理是:当元素的宽高为0,边框(border)不为0时,四个角边框交界重叠处分45度角平分。*/
.triangle {
border-color: red green blue pink;
border-style: solid;
border-width: 20px 20px 20px 20px;
width: 0;
height: 0;
}
/**** IE6 BUG FIX *****/
.ie6fix{
border-color: transparent #fc0 transparent transparent;
border-style: solid;
border-width: 16px 16px 16px 0px;
padding:0;
width:0;
height:0;
/*ie6 height fix*/
font-size:0;
line-height:0;
/*ie6 transparent fix*/
_border-top-color: #ffff00;
_border-bottom-color: #ffff00;
_filter: chroma( color=#ffff00);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment