gpt4 book ai didi

css - 如何使 Joomla 主要内容和模块列动态匹配高度?

转载 作者:太空宇宙 更新时间:2023-11-04 05:30:52 25 4
gpt4 key购买 nike

您好,我有一个 Joomla 网站,其模板有 2 列。一个用于主要内容,另一个用于模块。在不同的页面上,内容栏比模块栏短,反之亦然。我如何确保两列始终具有相同的高度,以便它们在任何页面的页脚处均等地相遇?

最佳答案

使用 Javascript:

window.addEvent('load', function(){  
// Load assuming there could be images.
// Otherwise use domready
var columns = $$('css selector for the columns');
if(columns && columns.length > 1){
var heights = [];
columns.each(function(el){
heights.push(this.getStyle('height'));
}).setStyle('height', Math.max.apply( Math, heights ));
delete(heights);
}
});

您可以使用 CSS 确保页脚位于页面底部。喜欢 Mootools。

关于css - 如何使 Joomla 主要内容和模块列动态匹配高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3248251/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com