https://jsfiddle.net/5mkt6ucr/
<div class="pwordCheck">
<label>Password </label> <input type="password" id="pword" data-placement="right" title="" data-original-title="Password must be more than 6 characters long" class="mytooltip"><br>
<label>Confirm Password </label> <input type="password" id="confpword" onkeyup="passwordValidation(); return false;" data-placement="left" title="" data-original-title="Passwords must match" class="mytooltip">
<span id="themessage" class="themessage"></span><br>
</div>
在我的 jsfiddle 中可以看到,一旦您开始输入密码并确认密码,就会弹出一条消息。但是,此消息将输入字段分流到左侧。我想知道你如何定位它以便它在不改变字段的情况下弹出。我试过做 position: absolute/relative 等并尝试改变宽度所以我觉得它正在挤压它。无济于事。 有人有解决办法吗? 谢谢
最佳答案
只需将 #firstform span 的 css 属性从 relative 更改为 absolute 作为
#firstform span{
position: absolute;
}
更新:
fiddle :https://jsfiddle.net/5mkt6ucr/14/
为搜索按钮图像添加一个属性
.glyphicon-search
{
position:relative !important;
}
关于javascript - 如何将 HTML 元素准确定位到您想要的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32758518/