2014-09-22 154 views
-1

我的三角形按鈕和圖像有問題。 在這裏,您是代碼>圖像寬度問題CSS

[http://codepen.io/Luiggi/pen/elACq?editors=110][1] 

在這裏,你是瞭解我的問題的圖像。如何將按鈕和圖像放置在裏面。 enter image description here

我希望有人能幫助我。非常感謝,

Luiggi

+0

你想將它定位在哪裏? – 2014-09-22 12:00:23

+0

我認爲你需要解釋這個問題。您的圖片並不真正幫助 – Turnip 2014-09-22 12:01:23

+0

您可以在CSS中設置圖片高度'img {height:20px;}' – Sam1604 2014-09-22 12:05:47

回答

2

如果我聽到你正確,你需要按鈕像圖像? 對於它你可以使用輸入類型按鈕和src屬性。 水木清華這樣的:

<input type="image" src="http://placekitten.com/g/300/150"> 

然後,你還要到位置(我認爲絕對是更好的)他們容器包裝你的形象。 您將有水木清華這樣的:

<div class="wrapper"> 
    <img src="/i/image.jpg"> 
    <input type="image" src="/i/btn1.png" class="btn1"> 
    <input type="image" src="/i/btn1.png" class="btn2"> 
</div> 

和CSS:

.wrapper { position: relative; } 
.wrapper .btn1 { position: absolute; bottom: 0; left: 0;} 
.wrapper .btn2 { position: absolute; bottom: 0; right: 0;} 
+0

感謝您的幫助!!!! – Luiggi 2014-09-22 13:35:08