Skip to content

Instantly share code, notes, and snippets.

/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
window.matchMedia || (window.matchMedia = function() {
"use strict";
// For browsers that support matchMedium api such as IE 9 and webkit
var styleMedia = (window.styleMedia || window.media);
// For those that don't support matchMedium
if (!styleMedia) {
var style = document.createElement('style'),
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license - IE8 VERSION! */
window.matchMedia = window.matchMedia || (function(doc, undefined){
var docElem = doc.documentElement,
refNode = docElem.firstElementChild || docElem.firstChild,
// fakeBody required for <FF4 when executed in <head>
fakeBody = doc.createElement('body'),
div = doc.createElement('div');
div.id = 'mq-test-1';
@webin
webin / ChromeSmallFont.html
Created April 17, 2014 02:06
chrome small font
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chrome Small Font</title>
<style>
.div1 {
font-size: 10px;
-webkit-transform-origin-x: 0; /* 去除偏移量 */
-webkit-transform: scale(0.83); /* 小于12号字体 */
@webin
webin / 5ColumnCSS.html
Created April 16, 2014 10:07
5 Column CSS Demo - Equal Height Columns with Cross-Browser CSS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2 Column CSS Demo - Equal Height Columns with Cross-Browser CSS</title>
<style>
body {
margin:0;
padding:0;
}
@webin
webin / 4ColumnCSS.html
Created April 16, 2014 10:05
4 Column CSS Demo - Equal Height Columns with Cross-Browser CSS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2 Column CSS Demo - Equal Height Columns with Cross-Browser CSS</title>
<style>
body {
margin:0;
padding:0;
}
@webin
webin / 3ColumnCSS.html
Created April 16, 2014 10:04
3 Column CSS Demo - Equal Height Columns with Cross-Browser CSS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2 Column CSS Demo - Equal Height Columns with Cross-Browser CSS</title>
<style>
body {
margin:0;
padding:0;
}
@webin
webin / 2ColumnCSS.html
Created April 16, 2014 10:04
2 Column CSS Demo - Equal Height Columns with Cross-Browser CSS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2 Column CSS Demo - Equal Height Columns with Cross-Browser CSS</title>
<style>
body {
margin:0;
padding:0;
}
@webin
webin / CssHack.html
Created April 16, 2014 09:28
CSS Hack Browser Compatibility List
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>CSS Hack</title>
<style type="text/css">
html {
padding-right: 0px; padding-left: 0px; font-size: 13px; padding-bottom: 0px; margin: 0px; padding-top: 0px; font-family: 'lucida grande', helvetica, sans-serif
}
body {
@webin
webin / KeepFooterBottom.html
Created April 16, 2014 09:24
pure css keep footer at the bottom of the page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>pure css keep footer at the bottom of the page</title>
<style>
html,
body {
margin: 0;
padding: 0;