我一直无法让页面底部的三个 div 正确对齐。我想要的是让他们并排坐成一排。我尝试更改#schedule、#sponsors 和#contact 的浮动、清除、位置、显示和边距属性,但它们总是希望彼此重叠。
这是它的 jsFiddle:http: //jsfiddle.net/MMcMurry16/bpU8M/
<!DOCTYPE html/>
<html>
<head>
<title>Matt McMurry Racing</title>
<link rel = "stylesheet" href = "R3.css">
</head>
<div id = "container">
<a href = "Main.html"><div id = "main"></div></a>
<a href = "Matt TV.html"><div id = "matt_tv"></div></a>
<a href = "24@16.html"><div id = "twentyfour"></div></a>
<a href = "Schedule.html"><div id = "schedule" class = "bottom"></div></a>
<a href = "Sponsors.html"><div id = "sponsors" class = "bottom"></div></a>
<a href = "Contact.html"><div id = "contact" class = "bottom"></div></a>
</div>
</html>
#container{
margin: auto;
width: 650px;
height: 650px;
border: 1px solid black;
}
#main{
width: 415.8px;
height: 415.8px;
clear: left;
float: left;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-right: 5px;
margin-bottom: 3px;
}
#matt_tv{
width: 201px;
height: 201px;
clear: right;
float: left;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-left: 5px;
margin-bottom: 7px;
}
#twentyfour{
width: 201px;
height: 201px;
clear: right;
float: left;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-left: 5px;
margin-bottom: 5px;
margin-top: 5px;
}
#schedule{
width: 201px;
height: 201px;
clear: right;
float: right;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-left: 5px;
margin-top: 5px;
margin-right: 20px;
}
#sponsors{
width: 201px;
height: 201px;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-right: 5px;
margin-top: 5px;
margin-left: 5px;
position: relative;
}
#contact{
width: 201px;
height: 201px;
float: left;
clear: left;
border: 1px solid #AF0000;
box-shadow: 2px 2px 3px #696969;
margin-right: 5px;
margin-top: 5px;
margin-left: 0px;
}
.bottom{
display: table-row;
margin-bottom: -305px;
}
谢谢。