In my project, I want to set my web homepage to four parts. So I defined four divs, about upleft, upright, downleft, downright in content div.
I want to set 20px padding in content div , the left border is OK, But the right side is wrong.
The upright and downright is exceeded the right border of content div.
I have defined the four parts CSS
The code is:
<body style="background:url(./image/taiyi.jpg); height:100%; width:100%;background-repeat:no-repeat">
<style>
.content{
margin-left:auto;
padding: 20px;
margin-right:auto;
width: 1400px;
height:850px;
background-color:white;
}
.content .uprow{
width: 1400px;
height: 400px;
text-align:center;
border: 1px solid #e5e5e5;
}
.content .uprow .upleft{
width: 600px;
height: 400px;
float: left;
background-color: white;
border: 1px solid #999;
}
.lm_title_con{
width: 600px;
height: 100px;
padding: 10px 20px;
}
.lm_title_con .lm_title{
width: 85px;
line-height: 45px;
height: 30px;
float: left;
line-height: 30px;
color: #3E6BC0;
font-size: 18px;
text-align: center;
border-bottom: 1px solid #3E6BC0;
}
.content .uprow .upright{
width: 600px;
height: 400px;
float: right;
background-color: white;
border: 1px solid #999;
}
.content .downrow{
width: 1400px;
height: 400px;
margin-top: 20px;
}
.content .downrow .downleft{
width: 600px;
height: 400px;
float: left;
border: 1px solid #999;
background-color: white;
}
.content .downrow .downright{
width: 600px;
height: 400px;
float: right;
border: 1px solid #999;
background-color: white;
}
</style>
<script type="text/javascript">
$(function() {
$("#header").load("header_02.html");
});
</script>
<div id="header"></div>
<div class="content">
<div class="uprow">
<div class="upleft">
<div class="lm_title_con">
<div class="lm_title">
中心宣传片
</div>
</div>
</div>
<div class="upright"></div>
</div>
<div class="downrow">
<div class="downleft"></div>
<div class="downright"></div>
</div>
</div>
<!--footer start-->
<div id="footer"></div>
<script>
$(function() {
$("#footer").load("../footer_02.html");
});
</script>
<!--footer end-->
</body>
</html>
I have set padding: 20px;
in content CSS.
But upright and downright div exceeded the right border.
I am confused, who can give me a help?