html - 将元素定位到右侧

标签 html css

我正在尝试使用 css3 制作类似的东西,但我不知道如何将搜索按钮定位在“结果”div 的右侧。不在标签之后

what i am trying to achieve

        <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>

演示:http://jsfiddle.net/t92c2/2/

关于html - 将元素定位到右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18738284/

相关文章:

css - 不允许 Chrome 访问我的外部文件?

javascript - 在 div 中显示所有结果

javascript - url 只隐藏 url 中显示的域名

html - 从导航栏打开模态窗口

html - 在没有溢出或截断的情况下,将图片排列在 html 表格中 2 行文本左侧的正确方法是什么?

css - 限制高度与页面底部的距离

css - 如果可以使用严格的 CSS 重新创建图像,那么该图像还有用吗?

javascript - 在多个地方使用 javascript 为相同的元素 id 更改 CSS 元素

css - 正文/容器的边框在 IE 11 中不可见

javascript - 延迟加载元素 jQuery