May 2013
2 posts
April 2013
8 posts
3 tags
March 2013
3 posts
Clearfix →
This is really useful.
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to...
February 2013
8 posts
Thought via Path
今天天气极好 – Read on Path.
1 tag
雪
January 2013
4 posts
1 tag
December 2012
5 posts
4 tags
November 2012
1 post
火锅 (Created with Gifture)
October 2012
3 posts
September 2012
3 posts
波光粼粼 (Created with Gifture)
July 2012
2 posts
不知道什么鱼 (Created with Gifture)
Some things beginners might not know about Sublime... →
alainmeier:
I’m a big fan of Sublime Text. As with many Mac programmers, I started on TextMate and then migrated over once Sublime Text 2 was released. When I started, however, there were a lot of things that I didn’t know about ST, so I’ve compiled a list of basic things that are excellent time savers.
June 2012
3 posts
May 2012
3 posts
1 tag
1 tag
April 2012
1 post
December 2011
6 posts
1 tag
2 tags
用margin负值做缩略图
图片需要一个父级元素,比如把图片放在一个段落<p>标签中。段落<p>作为图片的父级元素需要是浮动的或者有固定的宽度,否者自适应宽度的父级元素是不能用这种方法实现图片缩略的。
接下来把图片的上下左右四边的margin设成负值,除此之外,我们需要用到overflow:hidden这个属性,就这样,我们要做的事情完成了。
HTML
<p class="crop">
<a href="#"><img src="img.jpg" alt="css template" /></a>
</p>
CSS
.crop{
float:left;
margin:.5em 10px .5em 0;
overflow:hidden; /* this is important */
border:1px...
1 tag
奔跑,為了跌到
1 tag