我想讓兩個層橫向貼在一起。
<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title></title>
<style>
???#div1{
??? width:?100px;
??? height:?100px;
??? background-color:?#000000;
???}
???#div2{
??? width:?100px;
??? height:?100px;
??? background-color:?#0000FF;
???}
</style>
</head>
<body>
<div?id="div1"></div>
<div?id="div2"></div>
</body>
</html>
2016-11-05
兩個層的css都加入:float:left(左對齊)
?#div1{ ??? width:?100px; ??? height:?100px; ??? background-color:?#000000; ??? float:?left; ???} ???#div2{ ??? width:?100px; ??? height:?100px; ??? background-color:?#0000FF; ??? float:?left; ???}