嗨,在下面的代码中,我想在一行中显示标签,图像和输入内容,因为我使用了内联块,但无法正常工作。现在正在逐一显示。
html
<div class="person_pic">
<label>Please upload your photo</label>
<input type='file' name="image" onchange="readURL(this);" />
<img id="blah" src="#" alt="your image" />
</div>
的CSS
.person_pic {
margin-left: 201px;
display: inline-block;
font-weight:bold;
}
.person_pic label{
font-weight:bold;
}
好吧,实际上,默认情况下,img,标签和输入并排放置。
<label>Please upload your photo</label>
<input type='file' name="image" onchange="readURL(this);" />
<img id="blah" src="#" alt="your image" />
因为您有很大的利润,所以它会显示在新行中。如果扩展页面,它将在同一行上。
删除边距应该可以解决您的问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句