This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandomColor(){ | |
return "#"+(Math.random()*0.16777215).toString(16).substring(3,9); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 闭合浮动 | |
*@ Update: 2013-02-17 | |
*@ Usage: 在需要闭合浮动的元素上(浮动元素的父容器)加 .clearfix | |
*/ | |
.clearfix:after { | |
visibility: hidden; | |
display: block; | |
content: "."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 未知高度容器垂直居中 | |
*@ Update: 2013-10-20 | |
*@ Doc&Demo: http://www.liveme.org/about-the-vertical-center.html | |
*/ | |
.mod-vc { | |
text-align: center; | |
font-size: 0; | |
*word-spacing: -1px; /* IE6、IE7 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 文字溢出显示省略号 | |
*@ Update: 2013-08-04 | |
*@ Demo: http://www.liveme.org/table-fixed-and-text-auto-hidden.html | |
*/ | |
.ellipsis { | |
white-space: nowrap; | |
word-wrap: normal; | |
overflow: hidden; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 强制不换行 | |
*@ Update: 2013-08-04 | |
*/ | |
.nowrap { | |
white-space: nowrap; | |
word-wrap: normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 强制不换行 | |
*@ Update: 2013-08-04 | |
*/ | |
.nowrap { | |
white-space: nowrap; | |
word-wrap: normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 等高布局 | |
*@ Update: 2013-03-26 | |
*@ Usage: | |
* <div class="main eq-wrap"> | |
* <div class="content eq-bd">content</div> | |
* <div class="aside eq-bd">aside</div> | |
* </div> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: IE6下1px高度 | |
*@ Update: 2013-03-26 | |
*@ Usage: 在目标元素之间加一个空格的转义符 ,如:<div class="onepx"> </div> | |
* 或者考虑使用 1px 的 border-top 去代替。 | |
*/ | |
.onepx { | |
height: 1px; | |
line-height:1px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@ Name: 图片替换之隐藏文字[版本2] | |
*@ Desc: 图片加载完之前会显示文字,有利于ARIA | |
*@ Update: 2013-05-23 | |
*@ Doc: http://www.iyunlu.com/view/css-xhtml/62.html | |
*@ Example: <a href="#" class="logo ir-warp"><span classs="ir">home page</span></a> | |
* .logo { | |
* width: 100px; | |
* height: 40px; | |
* *background: url(../imgs/logo.jpg) no-repeat 0 0; |
OlderNewer