0
私はTo-Doリストアプリケーションを作成しようとしています。また、順序付けされていないリストを作成する2番目のdivになっても表示されず、なぜ表示されないのかわからないようです。私はそのdivを消去して、enw oneを作成し、簡単なhelloメッセージを書くことを試みましたが、それも表示されませんでした。私はそれがそれを許可しないために最初のdivと何かを持っていると推測しています。私の順序付けられていないリストを表示していない2番目のdiv?
<!doctype html>
<html>
<head>
<title>To Do list</title>
<style type="text/css">
#topBar-div{
background-color: #F44336;
position:absolute;
top: 0px;
width:100%;
height: 150px;
}
body{
margin: 0px;
padding: 0px;
}
h1{
color:white;
margin-left: 300px;
}
#textInput{
height: 30px;
margin-left: 100px;
width: 600px;
font-size: 20px;
color: #8E8E8E;
}
#addButton{
height:37px;
position:relative;
top:-4px;
right: 5px;
width: 70px;
color: grey;
}
#secondBar-div{
color: grey;
height: 350px;
width: 1000px;
}
</style>
</head>
<body>
<div id="topBar-div">
<h1>My To Do List</h1>
<input type="text" value="Title..." id="textInput">
<button id="addButton">Add</button>
</div>
<div id="secondBar-div">
<ul>
<li>Hit the gym</li>
<li>Pay bills</li>
<li>Meet George</li>
<li>Buy eggs</li>
<li>Study</li>
<li>Cook Dinner</li>
</ul>
</div>
<script type="text/javascript">
</script>
</body>
</html>
にこれを追加してみてください最初のdiv 'ポジション削除します。絶対に、'?または、2番目の位置を指定しますか? –
'position:absolute;'を使用すると、 "flow"からdivを取り出すので、2番目のdivはデフォルトで左上に配置されます。それは、同じ場所に配置された、他のもののすぐ後ろにあります。したがって、最初の「ブロック」が考慮されていないため、最初のブロックの下に2番目のブロックを移動する必要があります。 –