Back

CSS中的over flow. ( overflow in CSS layout)

发布时间: 2013-11-17 05:43:00

最近几天遇到一个问题: 如何实现土豆客户端中的预览。 ( these day I met a problem: I can't make a div's content scroll-x )

如图:     (略)

实际效果确实这样:  (图)

后来反思了一下,发现 这样的代码是可以正常工作的:   ( after thinking for a day, I found the code below works! )

    
Parent Div
Float Sub Div
Float Sub Div

所以问题的关键在于: 要让 Sub Div 的 宽度 大于 Parent Div 的宽度! 就可以了!  ( so the key is: make sure the "sub div"'s width is greater than parent div's width. 

(对于土豆客户端,最后我的解决方案是,把所有的div 放到一个大table中去。 这样 大table做为 子div就会使parent div呈现 overflow的状态  ( and for the solution of my case, I used a 'table' to wrap all the subdivs and then put this table to parent div. everything is ok now) 

Back