Skip to content

Instantly share code, notes, and snippets.

@hjzheng
hjzheng / css3_selector
Last active August 29, 2015 14:03
CSS3结构性伪类, 属性选择器, 其他伪类
CSS3结构性伪类:
E:nth-child(n) 表示E父元素中的第n个子节点
p:nth-child(odd){background:red}/*匹配奇数行*/
p:nth-child(even){background:red}/*匹配偶数行*/
p:nth-child(2n){background:red}
E:nth-last-child(n) 表示E父元素中的第n个子节点,从后向前计算
E:nth-of-type(n) 表示E父元素中类型为E的第n个子节点
E:nth-last-of-type(n) 表示E父元素中类型为E的第n个子节点,从后向前计算
E:empty 表示E父元素中没有子节点。注意:子节点包含文本节点
@hjzheng
hjzheng / css_color
Created July 11, 2014 06:56
CSS中颜色
颜色类型
Hex color
RGB color
RGBA color
HSL color
HSLA color
http://www.w3schools.com/cssref/css_colors_legal.asp
http://jsfiddle.net/user/dashboard/
@hjzheng
hjzheng / gist:72a3c28d379e627aa812
Last active August 29, 2015 14:03
CSS3 文字阴影
CSS3文字阴影
text-shadow:x y blur color, …
参数
x 横向偏移
y 纵向偏移
blur 模糊距离
color 阴影颜色
文本阴影如果加很多层,会很卡很卡很卡
http://jsfiddle.net/hjzheng/Khhx7/
@hjzheng
hjzheng / direction_and_overflow
Last active August 29, 2015 14:03
文字排列方式和定义省略文本
direction 定义文字排列方式(全兼容)
rtl 从右向左排列
ltr 从右向左排列
注意要配合unicode-bidi 一块使用
p {
width: 300px;
border: 1px solid #000;
font: 14px/30px "宋体";
direction: rtl;
@hjzheng
hjzheng / README.md
Last active August 29, 2015 14:07 — forked from addyosmani/README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@hjzheng
hjzheng / Emulation.txt
Created October 21, 2014 11:53
Chrome手机模拟器
Emulation 模拟器
一:Device 设备设置
1. model 模型选择
2. resolution 分辨率设置
3. Device pixel ratio 像素比设置
4. *Emulate mobile 模拟移动端特性
5. *Enable text autosizing 自动缩放字体
6. *Shrink to fit 缩放以适应屏幕
二:Media 媒体查询
@hjzheng
hjzheng / viewport.txt
Created October 27, 2014 11:15
viewport
<meta name="viewport" content="" />
width [pixel_value | device-width] width 直接去设置具体数值大部分的安卓手机不支持的 但是IOS支持
user-scalable 是否允许缩放 (no||yes)
initial-scale 初始比例
minimum-scale 允许缩放的最小比例
maximum-scale 允许缩放的最大比例
target-densitydpi
-- dpi_value 70–400 //每英寸像素点的个数
-- device-dpi 设备默认像素密度
-- high-dpi 高像素密度
@hjzheng
hjzheng / BSO.bat
Created May 29, 2015 07:39
BSO.bat
@echo off
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
REM 把127.0.0.1改为你要登录的IP地址
echo sh.SendKeys "open 127.0.0.1" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
@hjzheng
hjzheng / .zshrc
Last active August 29, 2015 14:26 — forked from puzza007/.zshrc
zsh config changes (override stuff set in oh my zsh)
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="robbyrussell"
ZSH_THEME="gentoo"
# Example aliases