答案 0 :(得分:6)
Divs会自动创建换行符,因为它们是块元素。尝试在div上使用display: inline-block
。
我现在更新了你的小提琴:http://jsfiddle.net/aqqUV/3/
请注意代码更改:
<div class="form" style="
margin-left: 70px;
color: white;
display: inline-block;
">
答案 1 :(得分:3)
只需给第一张图片一个宽度
display:inline-block;
float: left;
然后将这些权利赋予div以下图像
display:inline:block;
float:left;
答案 2 :(得分:0)
你可以尝试给第一个div一个宽度让它向左浮动。 下面的div元素应该漂浮在它旁边,但不要忘记清除:最后两个!
答案 3 :(得分:0)
我认为这可能会对你有所帮助 将图像更改为您的路径
<div>
<div style="float:left; width:33%">
According to the Oxford English Dictionary, hello is an alteration of hallo,
hollo,[5] which came from Old High German "halâ, holâ, emphatic imperative of halôn,
holôn to fetch, used especially in hailing a ferryman."[6] It also connects the development
of hello to the influence of an earlier form, holla, whose origin is in the French holà
(roughly, 'whoa there!', from French là 'there').
</div>
<div style="float:left; width:33%">
<img src="a.jpg" alt="Smiley face"/>
</div>
</div>