我正在尝试使用 css3 制作类似的东西,但我不知道如何将搜索按钮定位在“结果”div 的右侧。不在标签之后
<div id="ResultBox" style="margin-right:10px;margin-top:5px; height:90%;">
<div class="result" style="display:inline;">
<div style="height:100px; width:150px;">
Name:
<label>Mojtaba Iranpanah</label><br>
Email:
<label>00000000</label><br>
Phone Numner:
<label>00000000</label>
</div>
<div class="btn" style="float:right;">
<button>Search!</button>
</div>
</div>
</div>
最佳答案
这应该可以解决您的问题:
<div id="ResultBox" style="margin-right:10px;margin-top:5px; height:90%;">
<div class="result" style=""> <!-- display:inline here has no effect -->
<!-- Here is the place to put the display -->
<div style="display:inline-block; height:100px; width:150px;">Name:
<label>Mojtaba Iranpanah</label>
<br>Email:
<label>00000000</label>
<br>Phone Numner:
<label>00000000</label>
</div>
<!-- Here is the place to put the display -->
<div class="btn" style="display:inline-block; vertical-align: middle; height: 100px;">
<button>Search!</button>
</div>
</div>
</div>
关于html - 将元素定位到右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18738284/