正如你在下面的小提琴中看到的那样:http://jsfiddle.net/EvWc4/3/,我正在寻找一种方法将第二个链接(link-alt)与其父级(p)的右侧对齐.
为什么不使用float或position:绝对你会说,主要原因是我喜欢链接'display(inline-block)属性允许它们以一种自然的方式进行垂直对齐的事实.
通过使用float或position:absolute; 我将被迫计算并添加一些额外的margin-top或top值来垂直对齐链接.
这是代码,但更好地看到小提琴http://jsfiddle.net/EvWc4/3/:
<p>
<a href="#" class="link">link</a>
<a href="#" class="link link-alt">link alt</a>
</p>
p {
padding: 20px;
background: #eee;
}
.link {
display: inline-block;
padding: 10px;
background: #ddd;
}
.link-alt { padding: 20px; }
Run Code Online (Sandbox Code Playgroud) 我在尝试克隆github repo时收到以下消息:
git clone https://github.com/twbs/bootstrap.git
Cloning into 'test'...
warning: templates not found /share/git-core/templates
fatal: Unable to find remote helper for 'https'
Run Code Online (Sandbox Code Playgroud)
任何的想法 ?
有人可以解释为什么在下面的例子中,foo()返回整个promise而不仅仅是数据?如何让foo()只返回数据?
var foo = function() {
var promise = $.ajax({
type: 'POST',
url: 'http://example.com'
})
return promise.done(function(data) {
return data
})
}
console.log(foo())
Run Code Online (Sandbox Code Playgroud)
谢谢!
css ×1
curl ×1
git ×1
git-clone ×1
github ×1
javascript ×1
jquery ×1
promise ×1
return-value ×1
windows ×1