我对侧边栏的高度有疑问。我使用 jQuery 测量内容的高度,然后将此高度添加到侧边栏以显示侧边栏阴影。但它在 IE 中出现问题。
该网站的链接是:http://www.norwichkitty.com/business-directory/
请检查左侧边栏阴影问题..
$(document).ready(function() {
var blockheight = $('.right-content').height();
$('.sidebar').css('height', blockheight);
});
它的 CSS View 是
element.style {
height: 1592px;
}
.sidebar {
background: url("../img/sidebar-shadow.png") repeat-y scroll right center transparent;
float: left;
height: 100%;
overflow-y: auto;
position: relative;
width: 305px;
z-index: 999999;
}
如果有任何 CSS 解决方案可以解决这个问题..请告诉我..
谢谢大家
最佳答案
您可以将图像加宽到侧边栏的宽度,然后将其作为整个表格的背景图像,然后无论内容的高度如何,侧边栏图像都会在 y 轴上重复。
background: url(LINK_TO_IMAGE.png) repeat-y;
(ps.有什么理由必须是一张 table 吗?)
关于jquery - css高度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10725535/