創建網頁的標題這是style.css
:有三列
#top{
background: white;
text-align: center;
height: 180px;
border-bottom: solid 1px #efeecc;
}
#topLogo{
background: yellow;
width: 25%;
float:left;
}
#topDescription {
background: red;
width: 75%;
text-align: center;
}
#topDepartment {
background: blue;
float:right;
width: 25%;
text-align: right;
}
這是index.html
:
<div id="top">
<div id="topLogo">
<a href="index.html"><img src="img/book.jpg" width="170" height="160" border="0"/></a>
</div>
<div id="topDescription">
Page title
</div>
<div id="topDepartment">
Category
</div>
</div>
這是預期的結果:
這是當前的結局:
小提琴請http://jsfiddle.net – Yotam
@Yotam,http://jsfiddle.net/p2T5q/ –