我如何在标题中并排放置三个div

时间:2013-05-10 07:02:42

标签: html

HTML CODE

<div class="header" style="float:left">
<div class="logo">
<img src="some image" height="200px" width="200px"/>
</div>
<div class="name">company name</div>
<div class="pic">
<img src="some image" height="200" width="200"/>
</div>

</div>

CSS样式

header{background-color:red;width:1200px;height:400px;float:;}
.logo{width:17%;}
.name{color:#ADFF2F;font-size:48pt;margin-left:250px;width:38%}
.pic{;margin-left:950px;}

1 个答案:

答案 0 :(得分:2)

.header > div {
    float: left;
}

此外,CSS中的header课程需要在其前面加.

您还需要从.pic

中删除左边距

http://jsfiddle.net/samliew/DAC7p