Skip to content

Instantly share code, notes, and snippets.

View libo1106's full-sized avatar

libo libo1106

View GitHub Profile
@libo1106
libo1106 / liucun.html
Created December 17, 2012 02:20
超链接
<a href="javascript: void(0);"></a>
@libo1106
libo1106 / form.html
Created December 17, 2012 16:09
表单表单 可以用legend或者h4之类的描述fieldset的标题,并对其进行样式化 PS: Gist能支持zen-coding的话,更加完爆全场勒
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>表单label样式</title>
</head>
<style>
form{
width:400px;
margin: 20px auto;
@libo1106
libo1106 / html5.js
Created December 19, 2012 16:37 — forked from sofish/html5.js
<!--[if lt IE 9]>
<script type="text/javascript">
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
/*@cc_on(function(a,b){function r(a){var b=-1;while(++b<f)a.createElement(e[b])}if(!(!window.attachEvent||!b.createStyleSheet||!function(){var a=document.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}())){a.iepp=a.iepp||{};var c=a.iepp,d=c.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",e=d.split("|"),f=e.length,g=new RegExp("(^|\\s)("+d+")","gi"),h=new RegExp("<(/*)("+d+")","gi"),i=/^\s*[\{\}]\s*$/,j=new RegExp("(^|[^\\n]*?\\s)("+d+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),k=b.createDocumentFragment(),l=b.documentElement,m=l.firstChild,n=b.createElement("body"),o=b.createElement("style"),p=/print|all/,q;c.getCSS=function(a,b){if(a+""===undefined)return"";var d=-1,e=a.length,f,g=[];while(++d<e){f=a[d];if(f.di
@libo1106
libo1106 / base.css
Created December 19, 2012 16:42 — forked from sofish/base.css
@charset "utf-8";
/*
@名称: base
@功能: 重设浏览器默认样式
@例子: null
*/
/* 防止用户自定义背景颜色对网页的影响 */
html{
@libo1106
libo1106 / first-of-type.css
Created December 20, 2012 06:40
CodeReview
/*
* 对于:first-of-type伪类的使用
* IE8及以下浏览器不兼容该伪类
* 为了兼容IE6\7\8而去添加了一个.first这段代码,那:first-of-type还有意义吗?
*/
table tr:first-of-type th { /* Others */
background-image: url(/img/data_sheet_tr_bg.png);
background-repeat: repeat-x;
height: 31px;
}
@libo1106
libo1106 / gist:4351022
Created December 21, 2012 06:22
我写过最长的zencoding (>﹏<)
ul>li>a[href="javascript:void(0);"]+ul>li*2>a[href="javascript:void(0);"]
@libo1106
libo1106 / gist:4432910
Created January 2, 2013 07:41
绿色清理浮动
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:block;
}
.cf:after {
clear:both;
}
/* For IE 6/7 (trigger hasLayout) */
@libo1106
libo1106 / gist:4595990
Created January 22, 2013 16:22
Compress CSS with PHP
Minify.css.php?f=style.css
<?php
//重定义header
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset=UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
@libo1106
libo1106 / gist:4596186
Created January 22, 2013 16:49
Check if Element Exists
if ($('#myElement').length > 0) {
// it exists
}
@libo1106
libo1106 / gist:4603907
Created January 23, 2013 10:04
CSS3向下兼容那些事
.data-sheet tr:first-of-type th.selected { /* Others */
background-image: url(/img/data_sheet_th_selected_bg.png);
background-repeat: repeat-x;
height: 31px;
}
.data-sheet tr.first th.selected { /* IE6/IE7/IE8 */
background-image: url(/img/data_sheet_th_selected_bg.png);
background-repeat: repeat-x;
height: 31px;
}