CSS 动态宽度大于 100% [英] CSS dynamic width larger than 100%

查看:37
本文介绍了CSS 动态宽度大于 100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含浮动项目列表的父容器.添加新的浮动项目时,父容器会很好地向右扩展.

I have a parent container that holds a list of floated items. The parent container does nicely expand to the right when new floated items are added.

但是当我添加更多项目并且这些项目靠近窗口右侧时,新项目就会跳到新的一行.相反,我希望它继续向右扩展,使我的父容器大于 100%.

But as I add more items and the items come near the right side of the window the new item just jumps to a new row. Instead, I want it to keep expanding to the right, making my parent container larger than 100%.

是否可以将容器宽度定义为 max-width:infinite; 之类的东西?

Is it possible to define a container width to be something like max-width: infinite;?

为了回答我自己的问题,我知道我只能将最大宽度设为 5000% 或其他什么,但我只是想知道是否有更好的解决方案.我觉得页面的高度是 max-width:infinite 有点奇怪;并且页面的宽度不能具有相同的行为.

To answer my own question I know I just can make a max-width of 5000% or something, but I was just wondering if there is a better solution. I think it's a kind of strange that the height of a page is max-width: infinite; and the width of a page cannot have the same behavior.

也许这只是一个愚蠢的问题,但我还是问了:P.

Maybe this is just a silly question, but I ask it anyway :P.

推荐答案

我认为 overflow:visible 应该可以解决问题.

I think that overflow:visible should do the trick.

这篇关于CSS 动态宽度大于 100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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