如何将中间的列移动到左边的列?
http://jsfiddle.net/mnbayazit/zfBPQ/1/
本质上我想要
[ 33%剩余空间 | 100 像素 |剩余位置的 67% ]
这是我迄今为止所能达到的最接近的结果...
我正在尝试避免使用 JavaScript。使用 JS 一切都很简单...但我真的不想仅仅为了某些定位而依赖它。不保证用户启用它。
http://jsfiddle.net/mnbayazit/zfBPQ/1/
Essentially I want
[ 33% of remaining space | 100px | 67% of remaining place ]
This is as close as I've been able to get so far...
I'm trying to avoid using JavaScript. Everything's easy with JS... but I really don't want to rely on it just for some positioning. Users aren't guaranteed to have it enabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
仅靠 CSS 无法做到这一点。您需要使用 JavaScript 来计算剩余空间。在以下示例中,中间 div 为 100px,左侧为 33%,右侧为剩余空间的 67%。使用查询,您可以
在 http://jsfiddle.net/HpJXk/ 处检查工作示例
You cannot do this with CSS alone. You need to use JavaScript to calculate remaining space. In the following example, middle div is 100px, left is 33% and right is 67% of remaining space. With Query you can do
Check working example at http://jsfiddle.net/HpJXk/
哈!解决了。你们还说这不可能!
http://jsfiddle.net/mnbayazit/zfBPQ/3/
我必须复制 100px div,但不涉及 Javascript。
Hah! Solved it. And you guys said it couldn't be done!
http://jsfiddle.net/mnbayazit/zfBPQ/3/
I had to duplicate the 100px div, but there's no Javascript involved.