我有一個問題,對齊圖像在浮動到左邊的div。 在下面的代碼中如何將「logo.jpg」對齊到垂直和horizentally中心? 謝謝。對齊問題在浮動div
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" />
<title>layout</title>
<style type="text/css">
body,div,ul,li,dl,dt,dd,ol,p,h1,h2,h3,h4,h5,h6,form {font-size:11px; margin:0;padding:0;line-height: 150%;}
ul,ol,dl {list-style:none}
img {border:0;vertical-align:top;}
ul {list-style:none; padding:0; margin:0;}
#_layout {margin:0 auto; width:980px;}
#_top_cntr {width:980px; height:150px; background:#fff; margin-bottom:10px;}
/* top_cntr */
#_brand {height:110px; background:url(images/top_bg.jpg);}
#_left_logo {width:280px; height:110px; float:left; padding-left:10px;}
#_right_logo {width:680px; height:110px; float:right; margin-left:10px;}
</style>
</head>
<body>
<div id="_layout">
<div id="_top_cntr">
<div id="_brand">
<div id="_left_logo">
<img src="images/logo.jpg"/>
</div>
<div id="_right_logo">
</div>
</div>
</div>
</div>
</body>
</html>
to downvoters:考慮在投票時添加註釋 – haynar 2012-08-07 00:27:11