我得到了 4 个答案,其中一个是通过用户在“提问”组件中的选择而正确的。
所以,我想用 4 种输入样式和所有 4 种右边的 DIV 来做一个勾选标记“radio”......所以如果用户点击框......那个框会得到一个“勾选标记”,而其余的得到红色的“x”...
<div class="answer">
<input type="text" autocomplete="off" name="answer" id="answer-1" placeholder="Answer 1" class="form-control input" value="" />
<button type="radio" class="btn btn-success answer-type" style="" value="1">
<i class="glyphicon glyphicon-ok"></i>
<div class="left-check"></div>
</button>
</div>
问题是所有框都被拉到第一个输入的右上角。
帮忙吗?
最佳答案
您只需要添加以下额外的 CSS:
.answer { position:relative; }
更新示例:http://jsfiddle.net/58arV/1/
根据经验(可能根据 CSS 规范):绝对元素相对于它最近的父元素(相对或绝对)定位。
关于jquery - 多个定位对齐的类被拉到一个 div 而不是它们各自的 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19869240/