日期:2014-05-17  浏览次数:20740 次

给<body>设置了背景图片,却延伸到其内部的<table>,该如何处理?
网页部分代码如下:
HTML code

<body bgcolor="#f1f1f1">
<%dim page
page="index"
p_align="center"%>
<% call title() %>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="MainTD">


CSS部分代码如下:
CSS code

body {
    font-family: Verdana;
    font-size: 12px;
    line-height: 18px;
    color: #222222;
    background-image: url(images/bg.jpg);
    margin-top: 5px;
    margin-left: 0px;
}
.MenuTD {
    border-top-width: 2px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    border-top-color: #004891;
    border-right-color: #004891;
    border-bottom-color: #004891;
    border-left-color: #004891;
    filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#3369A0', endColorStr='#24579B', gradientType='0')
}


可是在火狐等某些浏览器中,Table部分也出现了在body中作为背景图片的background-image: url(images/bg.jpg),该如何处理,才能让Table部分不出现bg.jpg?

------解决方案--------------------
你给table也加个背景图片,覆盖body的背景图片