Html 扩展浮动菜单,使高度与内容div匹配
我有一个content div和一个边栏,content div的高度将根据加载的内容进行调整,但我希望边栏div一直向下延伸,根据内容的最大大小,边栏的大小应该相同 查看上面的提琴,我希望侧边栏一直向下延伸,这取决于内容分区的高度 对于非小提琴手:Html 扩展浮动菜单,使高度与内容div匹配,html,css-float,sidebar,css,Html,Css Float,Sidebar,Css,我有一个content div和一个边栏,content div的高度将根据加载的内容进行调整,但我希望边栏div一直向下延伸,根据内容的最大大小,边栏的大小应该相同 查看上面的提琴,我希望侧边栏一直向下延伸,这取决于内容分区的高度 对于非小提琴手: CSS HTML <div id="container" style="background-color: #f2f2f2"> <div id="content">Here is the content, the heig
CSS HTML
<div id="container" style="background-color: #f2f2f2">
<div id="content">Here is the content, the height of this div will vary depending on the content.
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<p>I dont want this big empty box. --> <br/>I want the sidebar extended down here--></p>
</div>
<div id="sidebar">I want this sidebar to extend ALL the way down, to match the #content divs height (whatever it is, dynamic)</div>
<div style="clear:both"></div>
这是内容,此分区的高度将根据内容而变化。
我不要这个大的空盒子
我希望侧边栏延伸到这里-->
我希望这个侧边栏一直向下延伸,以匹配#content divs高度(不管是什么,动态的)
您必须使用javascript来实现这一点。使用Jquery,它将类似于以下内容
$('#sidebar').height($('#content').height());
fiddle您必须使用javascript来实现这一点。使用Jquery,它将类似于以下内容
$('#sidebar').height($('#content').height());
拨弄