css - 当内容大于 div1 的大小时放置 div2

标签 css html height overflow

我尝试使用响应式 CSS 在移动设备上呈现页面。 我无法更改 html,我尝试仅使用 css 来解决我的问题。

想象一下我有一个这样的 div :

#example {
   width : 25px;
   height : 25px;
}

在这个 div 中,我有一个 1024*768 的图像。 所以内容比contener更大(我会展示所有内容) 我的问题是以下内容将放置在顶部 25px 处,而不是图像下方。

编辑:一个新的 jsfiddle,更精确:http://jsfiddle.net/eABu5/12/

你有什么想法吗? 非常感谢

最佳答案

LIVE DEMO

CSS

#example {
   width : 250px;
   height : 250px;
   background-color : #123456;
}

#pic {
   margin-top: 250px;
   float: left;    
}


#under {
   margin-top: 10px; 
   float: left;
}

关于css - 当内容大于 div1 的大小时放置 div2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19465808/

相关文章:

javascript - 如何停止在 div 中换行字符?或者

javascript - 在不同的 HTML 下拉选项上显示数据库值

javascript - 在 onclick 事件上组合 php 和 html 标签

android - EditText 的高度不会扩展到其父级的高度

html - 在 fullpage.js 中设置部分的高度

jquery - 调整大小后 100% 高度 div 向上滚动

css - 为什么我的两个表在 IE9 中无法并排显示

html - 悬停时图像摆动(比例效应)

css - 在触摸屏设备上禁用 CSS 规则

html - 为什么导航不在同一条线上?