Skip to content

Instantly share code, notes, and snippets.

/* new clearfix */
.clearfix
visibility: hidden
display: block
font-size: 0
content: " "
clear: both
height: 0
*zoom:1
@kmokidd
kmokidd / font-family
Last active September 29, 2016 02:58
为了兼容英文中文、Win和Mac,要注意font-family的使用
font-family:
/* 西文 */
-apple-system, BlinkSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helevetica, Arial,
/* 中文 */
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans CN", sans-serif;
@kmokidd
kmokidd / server.js
Last active May 31, 2017 21:13
Node.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs");
http.createServer(function (req, res) {
var pathname=__dirname+url.parse(req.url).pathname;
if (path.extname(pathname)=="") {
pathname+="/";
}
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon(s) in the root directory -->
.image-wall-wrapper{
font-size: 0;
}
.image-wall-wrapper .image-item{
display: inline-block;
background-size: cover;
background-repeat: no-repeat;
/*25% is for 4*4*/
width: 25%;
/*padding-top has the same value to width*/

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@kmokidd
kmokidd / text overflow
Last active March 9, 2017 09:25
处理文本截断
/* method 1 */
.parent-wrapper{
width: 100px; /*set by yourself*/
line-height: 1.05;
overflow: hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
/* method 2 */
html{
-webkit-touch-callout: none;
touch-callout: none;
-webkit-user-select: none;
user-select: none;
}
/* opacity is .8 */
.op{
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);
filter: alpha(opacity=80);
opacity: 0.8\0;
}
@media (orientaion: landscape){
body{
transform: rotate(-90deg);
}
}