【问题标题】:Html inline text is not following relative/absolute positioned radio/checkboxHtml 内联文本未遵循相对/绝对定位的单选框/复选框
【发布时间】:2019-09-15 19:59:32
【问题描述】:

radio/checkboxInline text 如果它们相对/绝对定位,则不会跟随它。我只想用内联文本来做。我怎样才能让它发挥作用?

<input type="radio" style="position:absolute; left:30px;top:40px;">Hi Follow me</input>

我在 Chrome 25 中对其进行了测试。

【问题讨论】:

  • 肮脏的方式可能是将控件放在 div 中并在 div 上使用您的样式。不过只是猜测。
  • 我们可以说这是一个浏览器问题,并且将来会解决吗?

标签: html radio-button absolute inline-code


【解决方案1】:

&lt;input /&gt; 包裹在&lt;span /&gt;&lt;div /&gt; 中是很常见的:

<div style="position:absolute;left:30px;top:40px;">
    <input type="radio" name="blah" />Hi Follow me
</div>

fiddle

【讨论】:

    猜你喜欢
    • 2018-01-11
    • 1970-01-01
    • 2015-03-20
    • 2016-06-04
    • 1970-01-01
    • 2014-01-19
    • 2012-10-30
    • 1970-01-01
    • 2010-09-28
    相关资源
    最近更新 更多