【问题标题】:Force new line to horizontally align with css强制新行与 css 水平对齐
【发布时间】:2013-11-02 23:59:16
【问题描述】:

这是我的例子:http://jsfiddle.net/SfTuD/1/

HTML:

<label class="longLabel">Create Document</label>

<input class="radioButton" checked="checked" value="true" id="Yes" type="radio"></input>

Allowed    

<input class="radioButton" value="false" id="No" type="radio"></input>

Not Allowed

<span class="description">A user with this permission will be allowed to create new Documents, Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</span>

CSS:

label {
    min-width:165px;
}
label.longLabel {
    width:165px;
}
input.radioButton {
    margin-right:5px;
}
.description {
    font-style: italic;
    padding-left: 20px;
}

我希望描述范围保持在单选按钮的右侧。也就是说,描述的新行应该与“A user...”对齐

我尝试过 display: inline-block,但这会强制整个跨度换行。

有什么想法吗?

【问题讨论】:

  • 只是一个建议:用li 元素、floatinline-block lis 中的标签包装输入。
  • 在 (X)HTML 中没有 &lt;/input&gt; 这样的东西
  • 在 FF 24 中看起来不错。您在哪个浏览器中看到问题?

标签: html css


【解决方案1】:

从你的 css 中删除这一行:

 display: inline-block;

【讨论】:

    猜你喜欢
    • 2013-03-12
    • 2020-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-07
    • 2011-05-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多