Skip to content

Instantly share code, notes, and snippets.

@lionhylra
lionhylra / center.css
Created September 6, 2013 03:48
centering the html content
html, body {
/*This is important!*/
text-align: center;
}
p {text-align: left;}
body {
margin: 0;
padding: 0;
@lionhylra
lionhylra / template.html
Created September 6, 2013 03:50
The very raw frame of a html file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="javascript.js"></script>
<title>LIONHYLRA</title>
</head>
@lionhylra
lionhylra / reg
Created September 6, 2013 03:52
regular expression
regular expression
操作符 描述
\ 转义符
(), (?:), (?=), [] 圆括号和方括号
*, +, ?, {n}, {n,}, {n,m} 限定符
^, $, \anymetacharacter 位置和顺序
| “或”操作
全部符号解释
字符 描述
\ 将下一个字符标记为一个特殊字符、或一个原义字符、或一个 向后引用、或一个八进制转义符。例如,'n' 匹配字符 "n"。'\n' 匹配一个换行符。序列 '\\' 匹配 "\" 而 "\(" 则匹配 "("。
@lionhylra
lionhylra / cookie.php
Created September 6, 2013 03:55
session and cookie control in php
@lionhylra
lionhylra / jquery.scrollto.js
Created September 10, 2013 15:41
jQuery.scrollto.js
/*!
* jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js
* Scroll smooth to any element in your DOM.
*
* Copyright (c) 2012 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/02/17
**/
$.scrollTo = $.fn.scrollTo = function(x, y, options){
if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments);
@lionhylra
lionhylra / animatin.css
Created September 12, 2013 02:54
css effectives
div{
animation:myfirst 5s;
-webkit-animation:myfirst 5s; /* Safari and Chrome */
}
@keyframes myfirst
{
from {background:red;}
to {background:yellow;}
}
@lionhylra
lionhylra / css3.css
Created September 12, 2013 03:05
css3 effects: round corner box shadow 圆角 边框图片 文字阴影 边框阴影 border image
div{
/*round corners*/
border-radius:25px;
/*box shadow*/
box-shadow: 10px 10px 5px #888888;
/*border image*/
border-image:url(border.png) 30 30 round;
@lionhylra
lionhylra / effects.css
Created September 12, 2013 03:09
often used css 阴影 透明 背景图 模糊
div{
/*background img*/
background-image: url(page_element/background.png);
background-repeat: repeat;
/*text shadow*/
text-shadow: 1px 0 0px #FF9BD4, 0 1px 0px #FF9BD4, 0 -1px 0px #FF9BD4, -1px 0 0px #FF9BD4;
/*tansparency*/
filter:alpha(Opacity=80);
@lionhylra
lionhylra / fixed_menu.css
Created September 12, 2013 03:10
fixed menu bar
#menu {
position:fixed;
_position:absolute; /* for IE6 */
_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); /* for IE6 */
left:0px;
top:50px;
width: 100%;
height: 50px;
padding:0 auto;
margin:0 auto 0 auto;
$.noConflict();
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.