Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在CSS中对齐此文本?_Css_Jsf - Fatal编程技术网

如何在CSS中对齐此文本?

如何在CSS中对齐此文本?,css,jsf,Css,Jsf,我在css中遇到了一个非常恼人的问题。我正试图在如下所示的表单代码中对齐输入字段的所有文本。出于某种原因,两个单词长的文本被踢到了第二行,例如下面的名字。有谁能帮我让它出现在一行上,因为我试着改变了很多事情,但它对我不起作用。这是JSF中表单的代码,我还附上了相关的CSS代码。谢谢 ## JSF ## <div class="register"><h:form id="registerForm"> <div class="white"><

我在css中遇到了一个非常恼人的问题。我正试图在如下所示的表单代码中对齐输入字段的所有文本。出于某种原因,两个单词长的文本被踢到了第二行,例如下面的名字。有谁能帮我让它出现在一行上,因为我试着改变了很多事情,但它对我不起作用。这是JSF中表单的代码,我还附上了相关的CSS代码。谢谢

## JSF ##
    <div class="register"><h:form id="registerForm">
    <div class="white"><h2>Add Business Account</h2></div>
    <h:messages errorClass="errorMessage" infoClass="infoMessage"
        warnClass="warnMessage"></h:messages>
    <table>
        <tr>
            <td><h:outputLabel for="firstName">
                    <h:outputText class="generaltext" id="firstNameLabel" value="First Name" />
                </h:outputLabel></td>
            <td><div class="inputboxpadding"><h:inputText class="inputboxes" id="firstName"
                    value="#{registerBean.businessAccount.firstName}" size="20" required="true" 
                    requiredMessage="Required field" validatorMessage="First name must contain between 3 and 15 characters">
                    <f:validateLength minimum="3" maximum="15"/>
                    <f:ajax event="blur" render="fnamemessage" /></h:inputText>
                    </div></td>
                    <td> <div class="validationbox"><h:message id="fnamemessage" for="firstName" class="validation"/></div></td>
        </tr>
        <tr>
            </h:commandButton></div></td>
        </tr>
    </table>
    <h:link value="Back to login" outcome="login" />
</h:form></div>


## CSS ##
.register {
font-family: Arial, Helvetica, sans-serif;
background-color: #6495ED;
width: 500px;
height:auto;
min-height:700px;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
margin-bottom: auto;
border-style: solid;
border-width: 1px;
border-radius: 20px;
padding: 100;
-moz-box-shadow: inset 0 0 10px #000000;
-webkit-box-shadow: inset 0 0 10px #000000;
box-shadow: inset 0 0 10px #000000;
}

.generaltext{
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight:bold;
color: white;
padding-left:20px;
padding-right:20px; 
}

请尝试为inputbox的div指定宽度

非常感谢现在我看到的非常明显的结果。我看了这么久,看不出问题出在哪里!