我想把标题放在图像的中心我试着放图像然后标题然后给标题负边距,但是当我这样做时,其他元素上去,使它看起来很糟糕如何把标题放在图像的中心
<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
使用的位置是:绝对 –