<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
标签 javascript jquery css
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
在此页面上enter link description here你看到右侧边栏了,我希望此列的高度与主要的中央列相同。 我认为这需要 javascript 或 css,但我不知道如何。 这是一个 Joomla CMS,但我可以在模块中添加一些代码。
谢谢。
最佳答案
您可以单独使用 CSS 解决这个问题,使用伪列技术,这里是一个演示:https://jsfiddle.net/1r8xygnL/ .我更新了下面的 ID 和 CSS,以反射(reflect)您链接到的页面上的 ID。
<div id="main">
<div class="faux-col-right"><!-- this is just for the background //--></div>
<div id="center">
<!-- center column content goes here //-->
</div>
<div id="right">
<!-- right column content goes here //-->
</div>
</div>
#main {
position: relative;
overflow: auto;
zoom: 1;
}
.faux-col-right {
background: #cccccc;
position: absolute;
left: 69.047619047619%;
right: 0;
top: 0;
bottom: 0;
z-index: 1;
}
#right {
width: 30.952380952381%;
float: left;
position: relative;
z-index: 2;
}
#center {
width: 69.047619047619%;
float: left;
}
关于javascript - 使用 javascript 或 css 自动高度 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31522192/