DIV中背景图片不显示

来源:百度知道 编辑:UC知道 时间:2024/09/21 03:37:00

定义一个DIV
#Header_bg{background:#FFCC99;margin: 0pt; padding: 0pt;background-image: url('images/headbg.jpg');}
在定义装LOGO的DIV
.logo{float:left;}
...
<div id="Header_bg">
<div class="logo"><img src="images/logo.gif"></div>
</div>

问题:
背景图片不显示.

用TALBLE表示意图
<table>外定义一个TALBE
<tr>
<td 背景>
<table>
<tr>
<td>LOGO</td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>

习惯TABLE,用DIV不熟,望高人指教,如回答上面问题20分,如解释DIV盒子和TABLE对应方法,50分,或100分.

这个是浮动问题,在header_bg里面加overflow:hidden;应该就没有问题了。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>功能菜单</title>
<style type="text/css">
#Header_bg{background:#FFCC99;margin: 0pt; padding: 0pt;background-image: url('images/headbg.jpg'); overflow:hidden;}
.logo{ float:left;}
</style>
</head>
<body>
<div id="Header_bg">
<div class="logo"><img src="images/logo.gif&q