<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
基本上,我有 2 个 div。 我必须重现以下效果。 图像必须溢出包含的白色 div,就像在图像中一样。 我如何使用 css 做到这一点?
提前谢谢你 我尝试过使用使图像大小大于包含的 div,并放置 overflow-y:visible 和 overflow-x:hidden,但效果是在 div 的右侧添加了一个滚动条,这不是我想要的想。
最佳答案
您可以通过在图像中定义 position:absolute
然后使用 top
和 left
属性定位它。
在这里,我已经为你做了例子:https://jsfiddle.net/hvkvf4px/
不要忘记在你的外部 div 上定义 position:relative
(白色背景的那个)
关于html - 使用 CSS 重现包含 div 效果的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30510777/