如何使图像与输入元素对齐 [英] How to make image align with input element

查看:90
本文介绍了如何使图像与输入元素对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实施代码后添加到div上更新

Update after implementing the code adding its on div

如何使图像位于城市输入元素旁边?

How can I make the image sit next to City input element?

HTML代码:

<div class="col-sm-12" id="assetList">
    <div class="col-sm-6" style="width:45% !important;">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">                         Name</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="Name" placeholder="Name">
                </div>
            </div>
        </div>
        <div class="col-sm-6" style="width:35% !important;">
            <div class="form-group ">
                <label for="inputEmail3" class="col-sm-2 control-label">                         City</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" id="City" placeholder="City">
                        <a class="action-image remove-action" href="javascript:void(0);">
                            <img alt="Remove" title="Remove" src="delete.png">
                            </a>
                        </div>
                    </div>
                </div>
            </div>


推荐答案

将此风格添加到您的风格:

Add this to your style:

.form-group {
  positon: relative;
}
.remove-action {
  position: absolute;
  top: 0px;
  right: -4px;
}

这篇关于如何使图像与输入元素对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆