2016-09-15 78 views
2

我想我試過每一個。必須有一些我不明白的東西。我在另一頁上以同樣的方式完成了這項工作,而且看起來工作正常。但現在,它沒有。哪裏不對?爲什麼我的圖片不會出現在下一行?

#musik {font-family: Verdana; float: left; font-size: 30px} 
 
#xdj {width: 650 px; height: 450px}
\t <strong><p id="musik"> M U S I K </p></strong> 
 
<br> 
 
\t <img id="xdj" src="xdj.jpg" alt="xdj-rx">

我只是wan't我的圖片,是標題下..

+2

刪除'浮動:左;' –

+0

它實際工作。我不明白浮動函數,但我猜。謝謝! – Munksgaard

+0

https://css-tricks.com/all-about-floats/ – BadHorsie

回答

5

你的代碼是有點亂。

我已經清理它並給出瞭解決方案,請參閱代碼中的註釋。

#musik { 
 
    font-family: Verdana; 
 
    /* float: left; remove this line */ 
 
    font-weight: 900; /* add this line, so you can remove the <strong> element */ 
 
    font-size: 30px 
 
} 
 
#xdj { 
 
    width: 650px; 
 
    height: 450px 
 
}
<p id="musik"> M U S I K </p> 
 
<img id="xdj" src="http://placehold.it/650x450" alt="xdj-rx">

相關問題