Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 等柱高_Html_Css - Fatal编程技术网

Html 等柱高

Html 等柱高,html,css,Html,Css,我希望东、西分区向下延伸,以匹配中心分区的高度。。。可能吗 非常感谢 .con{ padding-left: 22px; padding-right: 22px; overflow: hidden; } .col{ position: relative; float: left; } .west{ width: 7px; right: 22px; margin-left: -100%; background: url(http://www.example.com/west.png) rep

我希望东、西分区向下延伸,以匹配中心分区的高度。。。可能吗

非常感谢

.con{
padding-left: 22px;
padding-right: 22px;
overflow: hidden;
}

.col{
position: relative;
float: left;
}

.west{
width: 7px;
right: 22px; 
margin-left: -100%;
background: url(http://www.example.com/west.png) repeat-y;
padding: 0 0 0 15;
}

.east{
width: 7px;
margin-right: -22px;
background: url(http://www.example.com/east.png) repeat-y;
padding: 0 15 0 0;
}

.center{
width: 100%;
}


<div class="con">
  <div class="center col">
   Test Text<br/>
   Test Text<br/>
   Test Text<br/>
   Test Text<br/>
  </div>
  <div class="west col">
 </div>
 <div class="east col">
 </div>
</div>

您可以从这里为CSS所做的工作开始:


或者使用JavaScript布局。

我使用了这个jQuery解决方案,效果非常好

var maxHeight = 0;
$(".col").each(function(){
  maxHeight = $(this).height() > maxHeight ? $(this).height() : maxHeight;
}).height(maxHeight);​

仅供他人参考。正在尝试将其css化。

这看起来是