html - 如何在 td 中定位此微调器

标签 html css

我想这样做(见图片)-

enter image description here

我暂时有这个-

enter image description here

我的 html 代码是-

<td data-sort-initial="true" data-value="azerty" style="padding:5px;">
    <input class="form-control input-sm edit2" data-nom_champ="contact_label" data-id_ecole_contact="9" name="contact_label" type="text" value="azerty">
    <i class="fa fa-spinner fa-spin" id="waiting_9" style="display:none;position:relative;left:0px;top:2px;"></i>
</td>

我可以修改 top 和 left 的值,但这是正确的方法吗?是因为我在 td 元素中 ma 它不起作用吗?我应该放置一个 div 吗?

谢谢你的帮助

多米尼克

最佳答案

只需将td样式设置为

position: relative;

并更改为 i 样式:

position: absolute; right: 6px; top: 4px;

最终代码如下所示:

<table>
    <tr>
        <td style="position:relative">
          <input type="text"/>
          <i class="fa fa-spinner fa-spin" id="waiting_9" style="display:none;position: absolute; right: 6px; top: 4px;"></i>
        </td>
    </tr>
</table>

fiddle : https://jsfiddle.net/d1xasmLd/9/

关于html - 如何在 td 中定位此微调器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34967328/

相关文章:

css - CSS3中自动调整图像效果

jquery - 使子 div 移动父 div

html - 有没有办法让我的 anchor 链接出现在我的标题下方?

html - 具有全局类的第一个类型与本地类不同

javascript - 每次单击 li 的一部分时,href 都不会加载链接。使用javascript使整个li可点击

javascript - 标签 'width' 中的属性 'amp-carousel' 设置为无效值 'auto'

javascript - 获取计算的 CSS 属性(例如 : width) after view is rendered using Marionette Backbone. js

ios - 在全屏隐藏所有状态栏、浏览器地址栏的 iPhone 中打开 Asp.Net MVC 4 Web 应用程序

html - 载玻片相互堆叠

HTML 表格给我带来麻烦