1
我想知道如何創建兩個像HTML中的對象。我需要這兩個「桌子」位於右側,另一個位於頁面的左側。這樣他們就像平行表。每當我試圖用div來做這件事時,左手邊都完好無損,但右手邊看起來像是另一個的延續,我的意思是它的垂直對齊位於中間的某個位置,就在第一個「表「結束。Html divs表像
的html代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<link type="text/css" rel=stylesheet1 href="stylesheet1.css"/>
<title>Maths lessons</title>
</head>
<body background="img.jpg">
<h1 id="h1">
<center><B>Maths lessons</B></center></h1>
</h1>
<hr/>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div1">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
<div class="div2">Geometry</div>
</body>
</html>
.div1
{
width:10%;
border-radius:10px;
height:2%;
float:left;
}
.div2
{
width:10%;
border-radius:10px;
height:2%;
float:right;
#h1
{
font-family:Times,serif;
width:1000px;
height:50px;
text-align:center;
margin:auto;
}
郵編請 – jchapa 2013-03-13 20:13:12
哪裏是你的碼? – 2013-03-13 20:13:52
大聲笑,桌子....好的,你沒有桌子。對於表我們使用
回答
這裏的東西,可以幫助(點擊鏈接,並嘗試,改變並重新運行):
http://jsbin.com/amiyur/1/edit
來源
2013-03-13 22:05:14
實際上並沒有按照我預期的方式工作。它仍然像一頁左側的一張桌子。但無論如何感謝 – user2167174 2013-03-14 00:25:53
紅色的「桌子」在左邊,紅色的右邊是藍色的。下面還添加了一個白色的div。 – 2013-03-14 10:17:33
相關問題