如何在一行中对齐图像和两个跨度
<img src="../images/profile/profile.png" class="img" />
<span class="name">Firt Name</span>
<span class="comment">
This is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently this is end of count.
</span>
小提琴http://fiddle.jshell.net/m3qyhoab/
我将图像和跨度显示属性更改为阻止等..但仍然无法正常工作
答案 0 :(得分:0)
尝试使用表格:
<table>
<tr>
<td><img src="http://i450.photobucket.com/albums/qq229/veraqueen/80X80-1.jpg" class="img" /></td>
<td><span class="name">Firt Name</span></td>
<td> <span class="comment">
This is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently this is end of count.
</span></td>
</tr>
</table>
答案 1 :(得分:0)
答案 2 :(得分:0)
<强> CSS 强>
.wrapper {
max-width:800px;
margin:30px auto;
background-color:#ccc;
display:inline-block;
}
.img {
width:80px;
float:left;
margin-right:15px
}
.name {
float:left;
width:80px;
}
.comment {
float:left;
width:600px;
}
让你的工作正常你需要使用Float
将宽度硬编码到每个类
答案 3 :(得分:0)
答案 4 :(得分:0)
.wrapper {
max-width:800px;
margin:30px auto;
background-color:#ccc;
}
.img {
width:80px;
float:left;
margin-right:15px
}
.name {
float:left;
width:100px;
}
.comment {
float:left;
width:605px;
}
我提到的:
P.S。如果没有在一行中显示,请不要忘记将“结果”窗口移动到左侧。