當給定頂部保證金時,div「welove」也推動了它被包裹的div。我不希望發生這種情況。誰能告訴我我做錯了什麼?該網站是在這裏住:http://littleboxcreative.comcss保證金問題
--html--
<!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=utf-8" />
<title>Little Box Creative</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="jqtransformplugin/jqtransform.css" />
<link rel="stylesheet" type="text/css" href="formValidator/validationEngine.jquery.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />
<script type="text/javascript" src="js/jquery.jqtransform.js"></script>
<script type="text/javascript" src="js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="logo">
</div>
<div id="tagline">
<div class="tagline1">
</div>
<div id="headline">
</div>
<div class="tagline2">
</div>
</div>
</div>
<div id="body">
<div id="services">
</div>
<hr />
<div id="portfolio">
</div>
<div id="innerbody">
<div id="welove">
</div>
</div>
</div>
</div>
</body>
</html>
--css--
body {
background-color: #0E121B;
color: #ffffff;
}
#wrapper {
width:960px;
height: 100%;
margin:0 auto;
}
#header {
width: 960px;
height: 500px;
margin: 0 auto;
}
#logo {
width: 470px;
height:400px;
background-color: #ffffff;
float: left;
margin: 30px 5px 0 0;
}
#tagline {
width: 470px;
height: 400px;
float: left;
margin: 30px 0 0 0;
}
.tagline1 {
width: 379px;
height: 102px;
background-image: url('http://littleboxcreative.com/img/tagline1.png');
margin: 0 auto;
}
#headline {
border-top: 1px solid #080b10;
border-bottom: 1px solid #252e44;
height: 1px;
width: 370px;
margin: 40px 0 0 50px;
}
.tagline2 {
width: 407px;
height:96px;
background-image: url('http://littleboxcreative.com/img/tagline2.png');
margin: 50px 0 0 36px;
}
#services {
width:960px;
height: 500px;
background-image: url('http://littleboxcreative.com/img/niceback.jpg');
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: -5px -5px 15px #000;
-webkit-box-shadow: -5px -5px 15px #000;
box-shadow: -5px -5px 15px #000;
}
#portfolio {
width: 960px;
height: 500px;
background-image: url('http://littleboxcreative.com/img/paperback.png');
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: -5px -5px 15px #000;
-webkit-box-shadow: -5px -5px 15px #000;
box-shadow: -5px -5px 15px #000;
}
#innerbody {
width: 960px;
min-height:500px;
height: 100%;
background-image: url('http://littleboxcreative.com/img/backpattern.gif');
-webkit-border-radius: 0 0 10px 10px;
-moz-border-radius: 0 0 10px 10px;
border-radius: 0 0 10px 10px;
-moz-box-shadow: -5px -5px 15px #000;
-webkit-box-shadow: -5px -5px 15px #000;
box-shadow: -5px -5px 15px #000;
}
#welove {
width: 900px;
height: 200px;
margin: 45px 0 0 30px;
background-color: #000000;
opacity: 0.6;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
+1。我只是在輸入這個建議! – Liggy 2010-10-02 22:20:02
不錯,謝謝你的工作。 – Davey 2010-10-02 22:42:24