• <legend id='E6080'><style id='E6080'><dir id='E6080'><q id='E6080'></q></dir></style></legend>
      <bdo id='E6080'></bdo><ul id='E6080'></ul>

    <i id='E6080'><tr id='E6080'><dt id='E6080'><q id='E6080'><span id='E6080'><b id='E6080'><form id='E6080'><ins id='E6080'></ins><ul id='E6080'></ul><sub id='E6080'></sub></form><legend id='E6080'></legend><bdo id='E6080'><pre id='E6080'><center id='E6080'></center></pre></bdo></b><th id='E6080'></th></span></q></dt></tr></i><div id='E6080'><tfoot id='E6080'></tfoot><dl id='E6080'><fieldset id='E6080'></fieldset></dl></div>
      <tfoot id='E6080'></tfoot>

        <small id='E6080'></small><noframes id='E6080'>

        如何在不使用主题=“简单"的情况下使用 Struts 2 在同一行中定位多个文本字段?

        How to position multiple text fields in same line using Struts 2 without using theme=quot;simplequot;?(如何在不使用主题=“简单的情况下使用 Struts 2 在同一行中定位多个文本字段?)

          <tfoot id='p1aIK'></tfoot>
        1. <legend id='p1aIK'><style id='p1aIK'><dir id='p1aIK'><q id='p1aIK'></q></dir></style></legend>
            <tbody id='p1aIK'></tbody>

        2. <i id='p1aIK'><tr id='p1aIK'><dt id='p1aIK'><q id='p1aIK'><span id='p1aIK'><b id='p1aIK'><form id='p1aIK'><ins id='p1aIK'></ins><ul id='p1aIK'></ul><sub id='p1aIK'></sub></form><legend id='p1aIK'></legend><bdo id='p1aIK'><pre id='p1aIK'><center id='p1aIK'></center></pre></bdo></b><th id='p1aIK'></th></span></q></dt></tr></i><div id='p1aIK'><tfoot id='p1aIK'></tfoot><dl id='p1aIK'><fieldset id='p1aIK'></fieldset></dl></div>
              • <bdo id='p1aIK'></bdo><ul id='p1aIK'></ul>
              • <small id='p1aIK'></small><noframes id='p1aIK'>

                  本文介绍了如何在不使用主题=“简单"的情况下使用 Struts 2 在同一行中定位多个文本字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想使用 Struts 2 设计一个在同一行显示用户 ID 和密码的网页.

                  I want to design a webpage that display the user id and password in same line using Struts 2.

                  不使用theme='simple'如何管理?

                  How to manage it without using theme='simple'?

                   <%@taglib uri="/struts-tags" prefix="s" %>
                   <%@page contentType="text/html" pageEncoding="UTF-8"%><html>
                  <head>      
                  
                  </head>
                  <body>
                      <s:form action="Register.action">
                  
                          <s:textfield name="uid" label="User Name"/>
                          <s:password name="pass" label="Password"/>
                      </s:form>
                  </div>
                  

                  以上源码:

                  <!DOCTYPE html>
                  <html>
                      <head>      
                      </head>
                      <body>
                      <form id="Register" action="Register.action" method="post">
                          <table class="wwFormTable">
                              <tr>
                                  <td class="tdLabel">
                                      <label for="Register_uid" class="label">User Name:</label>
                                  </td>
                                  <td>
                                      <input type="text" name="uid" value="" id="Register_uid"/>
                                  </td>
                              </tr>
                              <tr>
                                  <td class="tdLabel">
                                      <label for="Register_pass" class="label">Password:</label>
                                  </td>
                                  <td>
                                      <input type="password" name="pass" id="Register_pass"/>
                                  </td>
                              </tr>
                          </table>
                      </form>   
                      </body>
                  </html>
                  

                  推荐答案

                  默认情况下 Struts2 使用 xhtml 主题,它用表格布局包装输入字段.表格布局利用其元素的独特定位,使用行和列.不能在同一行显示两行.

                  By default Struts2 is using xhtml theme, that wraps input fields with the table layout. A table layout utilizes unique positioning of its elements, using rows and columns. You can't display two rows on the same line.

                  另一方面,有一个主题 css_xhtml 正在使用

                  On the other hand there's a theme css_xhtml that is using

                  基于 CSS 的标准两列布局,用于 HTML Struts 标签(表单、文本字段、选择等)

                  Standard two-column CSS-based layout, using for the HTML Struts Tags (form, textfield, select, etc)

                  您可以更改元素的样式以显示内联.如果为 textfilds 生成 divs,您可以使用样式 dysplay: inline-block

                  you can change the style of elements to display inline. If divs are generated for textfilds them you can use a style dysplay: inline-block

                  内联块值

                  很长一段时间以来,可以创建一个填充浏览器宽度并很好地包裹的盒子网格(当浏览器调整大小),通过使用 float 属性.

                  然而,display 属性的 inline-block 值使得这个更容易.

                  However, the inline-block value of the display property makes this even easier.

                  inline-block 元素类似于 inline 元素,但它们可以有一个宽度和高度.

                  inline-block elements are like inline elements but they can have a width and a height.

                  代码:

                  <style>
                  .floating-box {
                      display: inline-block;
                  }
                  </style> 
                  
                  <s:form action="Register.action" theme="css_xhtml">
                  
                      <s:textfield name="uid" label="User Name" cssClass="floating-box"/>
                      <s:password name="pass" label="Password" cssClass="floating-box"/>
                  
                  </s:form>
                  

                  这篇关于如何在不使用主题=“简单"的情况下使用 Struts 2 在同一行中定位多个文本字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                  <small id='gq2XA'></small><noframes id='gq2XA'>

                      <legend id='gq2XA'><style id='gq2XA'><dir id='gq2XA'><q id='gq2XA'></q></dir></style></legend>

                          <tbody id='gq2XA'></tbody>
                          • <bdo id='gq2XA'></bdo><ul id='gq2XA'></ul>
                          • <tfoot id='gq2XA'></tfoot>

                          • <i id='gq2XA'><tr id='gq2XA'><dt id='gq2XA'><q id='gq2XA'><span id='gq2XA'><b id='gq2XA'><form id='gq2XA'><ins id='gq2XA'></ins><ul id='gq2XA'></ul><sub id='gq2XA'></sub></form><legend id='gq2XA'></legend><bdo id='gq2XA'><pre id='gq2XA'><center id='gq2XA'></center></pre></bdo></b><th id='gq2XA'></th></span></q></dt></tr></i><div id='gq2XA'><tfoot id='gq2XA'></tfoot><dl id='gq2XA'><fieldset id='gq2XA'></fieldset></dl></div>