
我试图将每列的宽度分别设置为25%,50%和25% – 也使所有div左侧浮动 – 在表格的两侧(div中间)有两个图像.不幸的是,这三个div是分开的线而不是并排.有人有任何提示或建议吗?任何帮助,将不胜感激.
注意:在添加事件时填充中间div(保持表).
<div ID = "container" style = "wIDth:100%"><div ID ="left" style = "float: left; wIDth: 25%;"> <?PHP echo $this->HTML->image('/img/sIDeart.jpg'); ?></div> <div ID = "mIDdle" style = "float: center; wIDth: 50%; height: 100%;"> <table cellpadding="0" cellspacing="0"> <tr> </tr> <?PHP foreach ($events as $event): ?> <tr> <td > </td> </tr><?PHP endforeach; ?> </table> </div> <div ID = "right" style = "float:right; wIDth: 25%;"> <?PHP echo $this->HTML->image('/img/sIDeart2.jpg'); ?> </div></div>解决方法 <div ID = "container" style = "wIDth:100%"> <div ID ="left" style = "float:left; wIDth: 25%;"> <?PHP echo $this->HTML->image('/img/sIDeart.jpg'); ?> </div> <div ID = "mIDdle" style = "float:left; wIDth: 50%;"> </div> <div ID = "right" style = "float:left; wIDth: 25%;"> </div></div> 没有浮动:中心这样的东西.通过将它们全部悬空,它们将彼此相邻排列.
总结以上是内存溢出为你收集整理的html – 如何在网页上并排放置三个div元素全部内容,希望文章能够帮你解决html – 如何在网页上并排放置三个div元素所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)