我有一個容器div爲900px寬的頁面,頁邊距是自動的。我有一個標題標籤在這個150px高。基本的CSS佈局
我希望標題由左側的ann圖像,右側的一些文本和另一個圖像(與左側的想象圖相對)組成。當我在標題div中放置兩個img標記時,第二個圖像比第一個低。我試圖修改內聯顯示沒有任何運氣。
任何想法?
CSS
html, body {
background-color: #ccd6cc;
margin: 0px;
padding: 0px;
}
body {
font-family: Arial, Helvetica, Verdana, Sans-serif;
font-size: 12px;
color: #666666;
}
.hidden {
display: none;
}
#page-container {
width: 900px;
margin: auto;
background-color: white;
}
#header {
height: 150px;
background-color: yellow;
}
#content {
line-height: 18px;
}
img#mcclogo {
display:inline;
float:left;
margin:0;
padding:0;
}
img#bactulogo {
display:inline;
float:right;
margin:0;
padding:0;
}
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="curvy.corners.trunk.js"></script>
<head>
<title>Intranet Layout</title>
<link rel="stylesheet" type="text/css" href="test_layout.css" media="screen" />
</head>
<body>
<div id="page-container">
<div id="header">
<img id="mcclogo" src="../images/logo.gif" alt="xx" width="244" height="48" />
<img id="bactulogo" src="../images/bactu3.gif" alt="xx" width="260" height="124" />
</div>
<div id="content">
Content
</div>
</div>
</body>
</HTML>
如果您在[jsfiddle](http://jsfiddle.net) – PeeHaa 2012-08-16 14:25:20
上發佈了您的相關代碼,並且可能演示了您是否嘗試將它們浮動,那真的會有幫助嗎? – 2012-08-16 14:25:21
用HTML和CSS更新您的文章 – Chandrakant 2012-08-16 14:27:47