【问题标题】:How to put an HTML form next to a text?如何将 HTML 表单放在文本旁边?
【发布时间】:2014-04-14 07:33:09
【问题描述】:

这是我的代码:

Topic one: <h:form> <h:commandButton value="+" /> <h:commandButton value="-" /> 
</h:form>

我希望 +- 按钮位于文本 Topic one: 旁边的同一行。

【问题讨论】:

  • 您是否意识到在这个问题的上下文中 JSF 仅仅是一个 HTML 代码生成器,并且您在使用 Topic one: &lt;form method="post"&gt;&lt;input type="submit" value="+"/&gt;&lt;/form&gt; 时也会遇到完全相同的问题?如果有,你熟悉 CSS 吗?
  • 谢谢,我对CSS不熟悉,用ma​​yabelle的解决方案解决了。

标签: html forms jsf


【解决方案1】:

在表单上使用这样的 css 类:

.your-class {
    display: inline;
}

【讨论】:

    【解决方案2】:

    &lt;h:panelGroup&gt;包裹你的按钮:

    <h:panelGroup>
        <h:commandButton value="+" /> <h:commandButton value="-" />
    </h:panelGroup>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-15
      • 2022-08-18
      • 1970-01-01
      • 2022-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多