私はCSSのノブで、CSSとDIVSで遊んでいました。 1。私は別のものの中に1つのdivを入れることができますが、私は2つだけバグを入れます。1 Divの中に2 Divを挿入する(左側に1つ、右側にもう1つ)
<html>
<head>
<link type="text/css" rel="stylesheet" href="style_divs.css">
</head>
<body>
<div id="table">
<div id="year">2017</div>
<div id="month">
<div id="previousMonth">Previous</div>
<div id="nextMonth">Next</div>
January
</div>
</div>
</body>
</html>
CSS
#table{
width:25%;
height:50%;
background-color: red;
margin: 0 auto;
}
#year{
width:100%;
height:10%;
background-color: blue;
margin: 0 auto;
text-align: center;
}
#month{
width:100%;
height:10%;
background-color: yellow;
margin: 0 auto;
text-align: center;
}
#previousMonth{
width:12%;
height:100%;
background-color: green;
margin-left: 0%;
text-align: center;
}
#nextMonth{
width:12%;
height:100%;
background-color: cyan;
margin-left: 88%;
text-align: center;
}
ありがとう: I could put the green Div inside of yellow div but not the cyan
は、ここに私のHTMLです。左と#nextMonthフロート:
'divs'で' float'を試しましたか? –
あなたの実際の質問は何ですか? –
うわー、ありがとう。私は今、とても馬鹿だと感じています。 –