更新时间:2023-10-24 22:49:04
将图像放置在居中的div中。给中心的div position:relative
。现在给图像 position:absolute
和 left:-XXpx
其中XX是图像的宽度。
How can I make a image float next to a centered box? What would be the correct HTML/CSS-code? Here's a outline of what I'm trying to make:
Thanks in advance.
Place your image inside the centered div. Give the centered div position:relative
. Now give the image position:absolute
and left:-XXpx
where XX is the width of your image.