私はレイアウトを設計していますし、私は2つの困難が午前:CSSの整列とサイズ
1)ドン」トンを理解なぜカレンダー(緑)であるdiv要素の高さは、その親と異なっています。
2)div内にulを置き、背景色 '#d1d2e0'を全幅に設定します。それは「リンク4」に行くだけです。
div.container
{
width:100%;
margin:0px;
background: #005884;
}
div.left
{
float:left;
width:160px;
margin:0;
padding:1em;
color: #d1d2e0;
background: green;
}
h3.header
{
padding:0;
margin:0;
}
div.right
{
margin-left:190px;
padding:1em;
text-align: right;
}
label.year{
\t padding: 0.4em 0.6em;
margin: 0;
\t background: #d1d2e0;
\t color: #36384e;
border-bottom: 1px solid #d1d2e0;
}
select#DropYear{
\t background: #36384e;
\t color: #d1d2e0;
\t width: 70px;
\t height: 30px;
\t margin: 0;
\t font-size: 16px;
\t text-align: center;
\t text-align-last: center;
}
div.nav{
width: 100%;
height: 30px;
\t color: 5px soldi red;
display: table-cell;
vertical-align: middle;
}
ul {
float: left;
width: 100%;
padding: 0;
margin: 0;
list-style-type: none;
}
a {
float: left;
width: 6em;
text-decoration: none;
color: #005884;
background-color: #d1d2e0;
padding: 0.2em 0.6em;
border-right: 1px solid white;
}
a.last { border-right: none; }
li.nav {
\t display: inline;
text-align: center;
}
.form{
\t width: auto;
height: 60px;
\t background: lightgrey;
}
select.form{
}
.content{
\t margin: 5px 0px;
\t width: auto;
height: 150px;
\t background: yellow;
}
.footer{
\t width: auto;
height: 20px;
\t background: grey;
}
<div class="container">
<div class="left"><h3 class="header">Calendar</h3></div>
<div class="right">
<label class="year" for="DropYear">Year</label><!--
--><select id="DropYear" class="drop">
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
</select>
</div>
</div>
<div class="nav">
<ul>
<li class="nav"><a href="#">Link one</a></li>
<li class="nav"><a href="#">Link two</a></li>
<li class="nav"><a href="#">Link three</a></li>
<li class="nav"><a href="#" class="last">Link four</a></li>
</ul>
</div>
<div class="form"></div>
<div class="content"></div>
<div class="footer"></div>
よろしく
ありがとうSergそれは素晴らしいです。クラス 'nav'を使ってdiv内の 'Calendar'を中心にするのを助けてください。 –
@ElioFernandes 'div.nav'の中には「カレンダー」はありません。もう少しやりたいことを説明してください。 –
申し訳ありません!私はdiv 'left'を意味しました –