Skip to content

Instantly share code, notes, and snippets.

View liveme's full-sized avatar
🎯
Focusing

David liveme

🎯
Focusing
View GitHub Profile
@liveme
liveme / break-word.css
Created March 21, 2014 06:13
连续字符换行
/*
*@ Name: 强制不换行
*@ Update: 2013-08-04
*/
.nowrap {
white-space: nowrap;
word-wrap: normal;
}
@liveme
liveme / nowrap.css
Created March 21, 2014 06:11
强制不换行
/*
*@ Name: 强制不换行
*@ Update: 2013-08-04
*/
.nowrap {
white-space: nowrap;
word-wrap: normal;
}
@liveme
liveme / ellipsis.css
Created March 21, 2014 06:09
文字溢出显示省略号
/*
*@ 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;
@liveme
liveme / mod-vc.css
Created March 21, 2014 06:08
未知高度容器垂直居中
/*
*@ 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 */
@liveme
liveme / clearfix .css
Last active August 29, 2015 13:57
clearfix
/*
*@ Name: 闭合浮动
*@ Update: 2013-02-17
*@ Usage: 在需要闭合浮动的元素上(浮动元素的父容器)加 .clearfix
*/
.clearfix:after {
visibility: hidden;
display: block;
content: ".";
@liveme
liveme / randomColor.js
Last active December 24, 2015 06:39
JavaScript随机获取十六进制 (hex)颜色
function getRandomColor(){
return "#"+(Math.random()*0.16777215).toString(16).substring(3,9);
}
@liveme
liveme / ieVersion.js
Last active December 22, 2015 10:49 — forked from padolsey/gist:527683
// ----------------------------------------------------------
// 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) {}