在网上看到一篇文章,关于现在流行的代码编辑器,突然看到这个Sublime Text 2,于是勾起了兴趣,之所以对这个编辑器感兴趣除了它小小的体积之外,更在于它那酷酷的深色界面.
Sublime Text 2 程序工作界面
先来一段简单的介绍:
速度快并且功能丰富,几乎支持所有的编程语言。支持多行选择,代码缩放,键盘绑定,宏,拆分视图等等。同时拥有全屏和免打扰 模式。非常适合大屏幕的显示。和TextMate类似,拥有一个非常活跃的社区支持,而且开发了很多的插件和bundle,以前我们介绍过的使用sublime text 2开发Javacript和jQuery,我们可以看到Sublime的强大。它同时支持Linux,Windows和OSX。这个编辑器可以无限期试用。当然你可以花59美元购买,并且安装到任何一台你自己的电脑上。
It started out two winters past
Time stood still we were moving too fast
You ran away April, May and June
When you came back I was over the moon
I was high, I was high over the moon
You were there, you were there midnight and noon oh
Bring it back, bring it back
We started too soon
I was high, I was high over the moon oh oh
Then came fall babe and we fell hard
Bruised our bodies, skinned our knees and our hearts
Then I got sick yeah but no one could tell
Now I drink your love drink right from the well
And it’s good and its good right from the well
Wanna taste, wanna touch, wanna see and smell oh
And it feels like it feels, heals me so well
Wanna drink, wanna drink right from the well oh oh
Now here I sit in my burning cell
Summer sun beating hotter than hell
I need your love like the air I breath
I need it more than you could ever believe
And you give and you give, give it to me
And you give and you give all that I need oh
And I take and I take, blood that you bleed
And you give and you give, give it to me oh
And you give and you give, give it to me
And you give and you give all that I need oh
And I take and I take, blood that you bleed
And you give and you give, give it to me oh
前几天, 听着音乐时,随机播放到这一曲<<Rhapsode in Blue(extract)>>,来自<<Best Piano Classics 100 (CD2)>>内track03.突然间,心中一股难以表达的心情.当然其他专辑也有,比如:<<The 50 Most Essential Pieces of Classical Music>>,当然也有电影Manhattan发行于1979年的插曲也是.
就是这曲,有一次几乎花了2,3个小时翻遍了每一首歌曲,却没有找到它,这次偶然再次遇到,当然不能再次忘记它的曲名,那么这个交响乐实际上应该是叫做<<Rhapsody in Blue>>于1924年美国作曲家乔治·格什温创作的.至于他的音乐背景大家可以自己去了解下.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>how to remove margins for first last elements</title>
<style type="text/css">
ul {
border: 1px solid #000;
margin: 0;
padding: 0;
list-style: none;
float:left;
}
ul li {
background:#eee;
color: #F00;
margin: 50px;
}
.first {
color: #000;
margin-top: 0 !important;
margin-left: 0 !important;
}
.last {
color: #0f0;
margin-bottom: 0 !important;
margin-right: 0 !important;
}
</style>
</head>
<body>
<ul>
<li class="first">Hello, This is first element</li>
<li>WOW, so many elements</li>
<li>WOW, so many elements</li>
<li>WOW, so many elements</li>
<li class="last">Here it is, The last element</li>
</ul>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>how to remove margins for first last elements</title>
<style type="text/css">
ul {
border: 1px solid #000;
margin: 0;
padding: 0;
list-style: none;
float:left;
}
ul li {
background:#eee;
color: #F00;
margin: 50px;
}
ul li:first-child {
color: #000;
margin-top: 0 !important;
margin-left: 0 !important;
}
ul li:last-child {
color: #0f0;
margin-bottom: 0 !important;
margin-right: 0 !important;
}
</style>
</head>
<body>
<ul>
<li>Hello, This is first element</li>
<li>Whidy! so many elements</li>
<li>Whidy! so many elements</li>
<li>Whidy! so many elements</li>
<li>Here it is, The last element</li>
</ul>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>how to remove margins for first last elements</title>
<style type="text/css">
ul {
border: 1px solid #000;
margin: 0;
padding: 0;
list-style: none;
float:left;
}
ul li {
background:#eee;
color: #F00;
margin: 50px;
}
ul li:nth-child(2n) {
color: #000;
margin-top: 0 !important;
margin-left: 0 !important;
}
</style>
</head>
<body>
<ul>
<li>Hello, This is first element</li>
<li>Whidy! so many elements</li>
<li>Whidy! so many elements</li>
<li>Whidy! so many elements</li>
<li>Here it is, The last element</li>
</ul>
</body>
</html>
当然这个在IE8以下包括IE8的版本都是不被支持的 😯 !
最后总结一下:first-child和:last-child伪类在IE6下是完全不支持的,而IE7和IE8仅支持:first-child,IE9是完全支持的.而:nth-child只有IE9支持,其他的比如Safari 3+, Firefox 3.5+ and Chrome 1+是完全支持以上效果的.