gpt4 book ai didi

html - 如何使与输入字段相邻的按钮位置响应?

转载 作者:太空宇宙 更新时间:2023-11-04 07:53:43 25 4
gpt4 key购买 nike

我有一个看起来像 this 的 div 结构在这里我们可以看到刷新按钮显示在输入字段旁边,它现在在 WebView 中可以正常显示,如果我们将 View 切换为响应式,比如 iphone 6s 或 7,就此而言任何设备,然后该按钮不会响应,即不会归结到相邻字段(两个输入字段之间)。请帮助我完成此操作或建议在设备 View 中显示此按钮的更好方法

代码如下:

CSS

.captcha-div{
margin-bottom: 28px !important;
}

.captcha-field{
margin-bottom: 15px !important;
border-radius: 8px !important;
}

.captcha-inpt{
border-radius: 8px !important;
height: 40px !important;
}

.refresh-icon{
display: block !important;
}

.refresh-btn{
margin-left: 15px !important;
height: 40px !important;
border-radius: 8px !important;
}

HTML

<body id="indexBody">
<div id="mainContainer" class="container-fluid">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div id="appBody" class="row app-body">
<div class="col-md-12 col-sm-12 col-xs-12">
<div>
<div class="input-group captcha-div">
<input oncopy="return false;" disabled="disabled" type="text" class="form-control form-control-manual captcha-field" id="mainCaptcha">

<input class="form-control captcha-inpt" type="text" id="txtInput" name="captcha" onpaste="return false;" />

<span class="input-group-btn refresh-icon">
<button id="refresh" onclick="Captcha();" class="btn btn-default refresh-btn" type="button">
<span class="glyphicon glyphicon-refresh"></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>

最佳答案

.captcha-div {
margin-bottom: 28px !important;
}

.captcha-field {
margin-bottom: 15px !important;
border-radius: 8px !important;
}

.captcha-inpt {
border-radius: 8px !important;
height: 40px !important;
}

.refresh-icon {
display: block !important;
}

.refresh-btn {
margin-left: 15px !important;
height: 40px !important;
border-radius: 8px !important;
}
.input-group {
padding-right: 50px;
}

.input-group-btn.refresh-icon {
position: absolute;
right: 0px;
width: 40px;
height: 40px;
}

.input-group-btn.refresh-icon button {
margin-left: 0px!important;
}
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<body id="indexBody">
<div id="mainContainer" class="container-fluid">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div id="appBody" class="row app-body">
<div class="col-md-12 col-sm-12 col-xs-12">
<div>
<div class="input-group captcha-div">
<input oncopy="return false;" disabled="disabled" type="text" class="form-control form-control-manual captcha-field" id="mainCaptcha">

<input class="form-control captcha-inpt" type="text" id="txtInput" name="captcha" onpaste="return false;" />

<span class="input-group-btn refresh-icon">
<button id="refresh" onclick="Captcha();" class="btn btn-default refresh-btn" type="button">
<span class="glyphicon glyphicon-refresh"></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>

你可以试试这个 CSS,

.captcha-div {
position: relative;
padding-right: 50px;
}
.input-group-btn.refresh-icon {
position: absolute;
right: 0px;
left: auto;
top: 0px;
width: 40px;
height: 40px;
}
.captcha-div input {
display: inline-block;
}
.input-group-btn.refresh-icon button {
margin: 0px!important;
}

关于html - 如何使与输入字段相邻的按钮位置响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47526676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com