开发者

How do i adjust the label width n make it bold ? in the jsp of Struts2 aplication?

I have an struts2 application with jsp pages where i have struts2 tags 开发者_Python百科something like this

<s:form action="contactus.action"  method="post"   name="ContactUs Form" >
    <s:textfield name="cust.fname" key="fname" size="25" maxlength="20" required="true" />
    <s:textfield name="cust.lname" key="lname" size="25" maxlength="20" required="true"/>
</s:form>

where i get the "label" and the "input " box , I have to make the label as bold and adjust the width for the long labels ,In the text.ftl i cannot make such changes i guess ?

Here i display the label from the resource bundle .

Then how do i adjust the label width n make it bold ?


When you write struts tags that are converted ultimately to HTML code as follows JSP Code using Struts Tags

 <s:form method="post">
        <s:textfield label="Name" name="name"/>
        <s:textfield label="Age" name="age"/>
        <s:submit/>
    </s:form>

Converted HTML Code

<form id="quizBasic" name="quizBasic" onsubmit="return true;"
    action="/struts2-showcase/validation/quizBasic.action" method="post">
    <table class="wwFormTable">
        <tr>
            <td class="tdLabel">
                <label for="quizBasic_name" class="label">Name:</label>
            </td>
            <td>
                <input type="text" name="name" value="" id="quizBasic_name" />
            </td>
        </tr>

        <tr>
            <td class="tdLabel">
                <label for="quizBasic_age" class="label">Age:</label>
            </td>
            <td>
                <input type="text" name="age" value="0" id="quizBasic_age" />
            </td>
        </tr>

        <tr>
            <td colspan="2">
               <div align="right">
                   <input type="submit" id="quizBasic_0" value="Submit" />
               </div>
            </td>
        </tr>
    </table>
</form>

so you can define default css class for label having name "label" and define clas like this in your css file, import that css file in your jsp and you can do what ever you want with that label

.label{
    color: red;
    font: bold;
    font-size: 20px;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜