我想把標題放在圖像的中心我試着放圖像然後標題然後給標題負邊距,但是當我這樣做時,其他元素上去,使它看起來很糟糕如何把標題放在圖像的中心
<div>
<img src="https://res.cloudinary.com/dte7bat2g/image/upload/v1488492447/sample.jpg" alt="rose image "
<h2>i want to put this heading in the center of the above image </h2>
</div>
設置圖片爲背景' - image' – Swellar
使用的位置是:絕對 –