小编inw*_*ust的帖子

如何在右边对齐一个内联块元素?

正如你在下面的小提琴中看到的那样: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)

css vertical-alignment

16
推荐指数
3
解决办法
7万
查看次数

警告:找不到模板/ share/git-core/templates | 致命:无法找到'https'的远程助手

我在尝试克隆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)
  • Windows 8.1
  • git版本1.8.5.2.msysgit.0
  • 在我的路径:C:\ Program Files\Git\cmd; C:\ Program Files\Git\bin
  • http://windows.github.com/也安装在我的系统上(克隆它正在运行)

任何的想法 ?

windows git curl github git-clone

5
推荐指数
1
解决办法
1万
查看次数

使用jQuery返回AJAX promise的结果

有人可以解释为什么在下面的例子中,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)

谢谢!

javascript jquery return-value promise

5
推荐指数
1
解决办法
2万
查看次数