CSS +DIV添加图片后背景不对的问题

来源:百度知道 编辑:UC知道 时间:2024/05/25 03:44:05
请看如下相关css文件的代码:
body {
background: #00007B;
font: 0.75em Trebuchet MS;
color: #00007B;
margin: 0px;
margin-left: auto;
margin-right: auto;
width: 800px;
}
img {
border: 0px;
}
a {
color: #00007B;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}

#mainpage {
width: 800px;
background: #0861E7;
margin: 0px;
padding: 0px;
float: left;
border: 1px solid #000000;
}

#header {
padding:0px; width: 800px;

background: #00007B url('images/name.gif');
background-repeat: no-repeat;
height: 60px;
float: left;
border-bottom: 0px solid #000000

}

#header .box {

background: #000000;
}

#logo {

height: 60px;
float: left;
padding-left:0px; padding-right:0px; padding-top:0px; paddi

我的理解是这样的,不知道是不是你说的那种效果
<!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">
<!--
body {
background: #00007B;
font: 0.75em Trebuchet MS;
color: #00007B;
margin: 0px;
margin-left: auto;
margin-right: auto;
width: 800px;
}
img {
border: 0px;
}
a {
color: #00007B;
text-decoration: none;
font-weight: bold;
}
a:hover {