如何使用jsp使h1标签出现在一条(相同)行中

时间:2012-06-06 14:39:44

标签: jsp jsp-tags

我有两个文本框,一个用于第一个文本,另一个用于第二个文本。每个都有一个下拉列表 用于选择尺寸的框(因此它们可以是不同的或相同的尺寸)。现在我可以选择不同的 尺寸,它工作正常。我遇到的麻烦是它们以两种不同的方式显示 像这样的行:

       first text
       second text

但我希望它们彼此相邻显示。例如

      first text second text

我现在的代码如下:

 <c:choose>
   <c:when test="${! (empty (properties['first']) && empty (properties['second']))}">
    <c:choose>
        <c:when test="${properties['type'] == 'styled'}">
            <h1 class="aaaa">
                <span>first text</span>
            </h1>
        </c:when>
        <c:otherwise>
            <h2 class="bbb">
                <span class="putColor">first text</span>
            </h2>
        </c:otherwise>
    </c:choose>
    <c:choose>
        <c:when test="${properties['type1'] == 'styled'}">
            <h1 class="aaaa">
                <span class="putColor">second text</span>
            </h1>
        </c:when>
        <c:otherwise>
            <h2 class="bbb">
                <span class="putColor">second text</span>
            </h2>
        </c:otherwise>
    </c:choose>
</c:when>
<c:otherwise>       
    <div class="hhhh">

    </div>      
</c:otherwise>
 </c:choose>

1 个答案:

答案 0 :(得分:1)

尝试将style="display: inline;"添加到您的h1代码中。 (当然,你真的应该在你的CSS文件中这样做,但这会很快告诉你它是否有效。)