如何在 HTML 中將一個圖像放置在另一個圖像的頂部? - How do I position one image on top of another in HTML?

問題:

I'm a beginner at rails programming, attempting to show many images on a page.我是 Rails 編程的初學者,試圖在頁面上顯示許多圖像。 Some images are to lay on top of others.有些圖像要放在其他圖像之上。 To make it simple, say I want a blue square, with a red square in the upper right corner of the blue square (but not tight in the corner).爲了簡單起見,假設我想要一個藍色方塊,在藍色方塊的右上角有一個紅色方塊(但在角落處不緊)。 I am trying to avoid compositing (with ImageMagick and similar) due to performance issues.由於性能問題,我試圖避免合成(使用 ImageMagick 和類似的)。

I just want to position overlapping images relative to one another.我只想相對於彼此定位重疊的圖像。

As a more difficult example, imagine an odometer placed inside a larger image.作爲一個更困難的例子,想象一個里程錶放置在一個更大的圖像中。 For six digits, I would need to composite a million different images, or do it all on the fly, where all that is needed is to place the six images on top of the other one.對於六位數字,我需要合成一百萬張不同的圖像,或者即時完成所有操作,只需將六個圖像放在另一個圖像的頂部。


解決方案:

參考一: https://en.stackoom.com/question/Cbq
參考二: https://stackoom.com/question/Cbq
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章