我一直無法讓頁面底部的三個div正確對齊。我想要的是讓他們並排坐在一起。我曾嘗試更改#schedule,#sponsors和#contact的浮動,清除,位置,顯示和邊距屬性,但他們總是希望相互重疊。Divs保持重疊
這裏是的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 = "[email protected]"><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;
}
感謝。
這是好的,但它應該是一個評論,因爲它不是一個正確/完整/有效答案。 – Luis