-2

代码

<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;}
4

1 回答 1

2
.header > div {
    float: left;
}

此外,您header在 CSS 中的类需要.在其前面有一个。

您还需要从.pic

http://jsfiddle.net/samliew/DAC7p

于 2013-05-10T07:08:14.350 回答