Css 跨浏览器三列布局

Css 跨浏览器三列布局,css,layout,Css,Layout,假设我有一行三列——左右两侧有一些按钮,中间宽度不固定 如果中间一栏的内容延伸到中间一栏的区域,溢出的内容应该隐藏起来 该解决方案在Firefox上运行良好,但Opera和IE6的输出有很大不同 <div style="width:/fluid/"> <input type="image" src="img1.png" style="margin: 4px 0 0 5px; float: left;"/> <input type="image" src=

假设我有一行三列——左右两侧有一些按钮,中间宽度不固定

如果中间一栏的内容延伸到中间一栏的区域,溢出的内容应该隐藏起来

该解决方案在Firefox上运行良好,但Opera和IE6的输出有很大不同

<div style="width:/fluid/">
   <input type="image" src="img1.png" style="margin: 4px 0 0 5px; float: left;"/>
   <input type="image" src="img2.png" style="margin: 4px 5px 0 0; float: right;"/>
   <input type="image" src="img3.png" style="margin: 4px 5px 0 0; float: right;"/>
   <input type="image" src="img4.png" style="margin: 4px 5px 0 0; float: right;"/>
   <div style="margin: 0pt 68px 0pt 26px;">
      <p style="margin: 0; cursor: pointer; overflow: hidden;">abcdefghijklmnopqrstuvxy</p>
   </div>
</div>

abcdefghijklmnopqrstuvxy

在Firefox上,所有这些都按预期显示在一行上——左侧一个按钮,右侧三个按钮,内容的可见部分取决于div容器的宽度

在Opera上-不适合一行的部分内容将在下一行继续


在IE6上-按钮在第一行,内容在下一行完整显示。

请发布示例代码。它只是格式不好。已修复。请发布示例代码。它在那里只是格式不好。修正了,我用这个@Nosredna那你为什么不把它作为一个单独的答案贴出来呢?看起来和你的答案没有太大的区别,值得:-)我用这个@Nosredna那么你为什么不把它作为一个单独的答案发布呢?看起来和你的答案没有太大的不同,值得一提:-)