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

时间:2013-10-19 12:03:26

标签: css html height overflow

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

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

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

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

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

你知道吗? 非常感谢

1 个答案:

答案 0 :(得分:2)

LIVE DEMO

CSS

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

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


#under {
   margin-top: 10px; 
   float: left;
}
相关问题