2016-03-16 32 views
1

我想都在不同的角落,例如,左上,右上,右下,右下錨圖像,並在中心之一謝謝CSS - HTML如何使錨圖像去一個特定地點

如何讓我所有的錨鏈接/圖片轉到特定的一面我希望左上角的球隊我希望存儲右上角贊助商左下角和關於我們右下角我認爲我做了所有正確的代碼,噸如何起來的特定點

如果有人可以幫助將是非常讚賞

http://pastebin.com/Yjth4U93

JSFIDDLE

的CSS

.section-links { position: relative; height: 500px; background-color: #c3c3c3 ; } 
.section-links a { position: absolute; } 
.section-links a.top-left { top: 10px; left: 10px; } 
.section-links a.top-right { top: 10px; right: 10px; } 
.section-links a.bottom-left { bottom: 10px; left: 10px; } 
.section-links a.bottom-right { bottom: 10px; right: 10px; } 

的Html

<div class="section-links"> 
    <a href="teams.html" class="top-left"> 
    <img style="width: 100px;" src="icon1.jpg" alt=""> 
    </a> 
    <a href="teams.html" class="top-right"> 
    <img style="width: 100px;" src="icon2.jpg" alt=""> 
    </a> 
    <a href="teams.html" class="bottom-left"> 
    <img style="width: 100px;" src="icon4.jpg" alt=""> 
    </a> 
    <a href="teams.html" class="bottom-right"> 
    <img style="width: 100px;" src="icon3.jpg" alt=""> 
    </a> 
</div> 

預先感謝您。

+1

在你的代碼的圖像會在各個角落等。我不知道你問什麼。你想讓圖像暴露一些鏈接? – Devian

+0

當我在chrome中打開它時,所有圖像都保留在外面,並且它們不在所有角落 – CreepyC

+0

我將您的代碼移至'jsfiddle'以更好地測試,請查看此[鏈接](https://jsfiddle.net/LL4orf6p/ )並告訴我們你的問題究竟是什麼?我看到你的角落裏的所有形象。 – Pedram

回答

1

HTML

<link rel="stylesheet" href="main.css" media="screen" title="no title" charset="utf-8"> 

CSS

.section-links { 
    position: relative; 
    height: 500px; 
    background-color: #c3c3c3 ; 
} 

.top-left { 
    top: 10px; left: 10px; 
    position: absolute; 
} 

.top-right { 
    position: absolute; 
    top: 10px; right: 10px; 
} 
.bottom-left { 
position: absolute; 
bottom: 10px; left: 10px; 
} 
.bottom-right { 
    position: absolute; 
    bottom: 10px; right: 10px; 
} 
+0

我做了測試,並喜歡它的工作 – DanyCode

+0

我覺得很愚蠢大聲笑我沒有那個代碼,但我的朋友說這是不對的 – CreepyC

+0

不必,我們總是從「錯誤」學習 – DanyCode

相關問題