我試圖在導航欄左側的我的網站上的div的頂部欄上方放置圖片。 My Attempt在div上面放置圖片將內容推到其他地方
看起來應該Like this
而且我想它看起來Like this
我已經試過許多東西,比如放置在div中的代碼不同點的圖像,並改變CSS元素對於DIV,但一切似乎推其他內容圖像不恰當的網站
我試圖在導航欄左側的我的網站上的div的頂部欄上方放置圖片。 My Attempt在div上面放置圖片將內容推到其他地方
看起來應該Like this
而且我想它看起來Like this
我已經試過許多東西,比如放置在div中的代碼不同點的圖像,並改變CSS元素對於DIV,但一切似乎推其他內容圖像不恰當的網站
添加此上...
.photo {
position: relative;
top: 4px;
}
和改變的#container的保證金......
#container {
margin-top: -1px;
}
你的CSS不是挺好的,但是,使用方法,這裏是如何做到這一點:
margin-top
從#container
vertical-align: top
到img
內#photo
top
在#extraDiv1
至246px
.horizontal
的top
到218px
我想這應該這樣做。
很好用,但是有沒有辦法去除圖片底部和div邊框之間的空隙,以便它像導航欄一樣位於頂部? http://justmyshit.com/shaunmichael/ – syllable3 2012-07-20 00:24:32
@ syllable3將'line-height:150%;'屬性從你的身體移動到UL,或將'line-height:100%;'添加到照片div。 – Quantastical 2012-07-20 00:27:18
我上面的CSS將照片向下移動4px,那對你沒用嗎? – hackattack 2012-07-20 00:31:56