2014-01-31 49 views
1

我有一個非常非常簡單的佈局和設計,但我無法設置鏈接的垂直邊距。這裏是一個簡短的例子:谷歌瀏覽器中的鏈接的垂直邊距

<a href="http://www.google.de/">Google</a> 
<a href="http://www.youtube.com/" style="margin-top: 20px; ">YouTube</a> 
<a href="http://www.foo.de/">Bar</a> 

每次第二個鏈接具有所有其他鏈接相同的邊距。這是Google Chrome的錯誤,以及如何解決這個問題?

編輯: 有沒有辦法解決它,而沒有包裝鏈接在div

回答

1

像這樣?

<a href="http://www.google.de/">Google</a> 
<a href="http://www.youtube.com/" style="display:inline-block;margin-top: 20px;">YouTube</a> 
<a href="http://www.foo.de/">Bar</a> 
+0

謝謝。用'display:inline-block;'它工作:) – Cubinator73

+0

我已經改變了我的答案以反映這一點!謝謝@ Cubinator73,很高興我能幫忙:) – Albzi

1
<a href="http://www.google.de/">Google</a> 
<a href="http://www.youtube.com/" style="position:relative;top:20px;">YouTube</a> 
<a href="http://www.foo.de/">Bar</a>