私はCSSを学んでいますが、私が理解していない振る舞いがありますので、下のコードを見てください。divのテキストが上から表示されない理由
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#testDiv{
width: 100px;
height: 100px;
background-color: lightblue;
float: left;
}
#testDiv1{
width: 100px;
height: 200px;
background-color: red;
}
</style>
</head>
<body>
<div id="testDiv"></div>
<div id="testDiv1">
<p>
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.his is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.his is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
</p>
</div>
</body>
</html>
私が最初のdivはsceond 1をカバーします知っているが、なぜ第二のdiv内のテキストをカバーすることがないのですか?最初のdivの後の位置から表示されます。
感謝。私は、なぜテキストがページの上部から表示されないのかを見ると、最初のdivの下に表示されます。 – Allen4Tech
@ Allen4Techもう一度私の答えを更新しました。それはあなたのために物事をクリアしますか? – LGSon