如何让图像浮动在中心的div旁边? [英] How can I have an image float next to a centered div?

查看:221
本文介绍了如何让图像浮动在中心的div旁边?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让图片浮动在中心框的旁边?什么是正确的HTML / CSS代码?这里是我想要做的概要:



解决方案

将图像放置在居中的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.

这篇关于如何让图像浮动在中心的div旁边?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆