Salesforce 如何控制VisualForce页面中顶点输入字段的宽度

Salesforce 如何控制VisualForce页面中顶点输入字段的宽度,salesforce,apex-code,visualforce,force.com,Salesforce,Apex Code,Visualforce,Force.com,由于标准页面布局不允许您调整绑定到文本字段的inputfield的宽度,因此我尝试创建VisualForce页面,但apex:inputfield组件没有宽度属性。我想我将不得不使用样式或CSS或其他东西,但我不知道如何使用 我需要做什么来调整文本输入字段的宽度 请提供使用web界面(非Force.com IDE)的说明。谢谢 编辑 我最终使用了这样的嵌入式样式 <apex:inputfield value="{!Country__c.Full_Name__c}" style="width

由于标准页面布局不允许您调整绑定到文本字段的inputfield的宽度,因此我尝试创建VisualForce页面,但apex:inputfield组件没有宽度属性。我想我将不得不使用样式或CSS或其他东西,但我不知道如何使用

我需要做什么来调整文本输入字段的宽度

请提供使用web界面(非Force.com IDE)的说明。谢谢

编辑

我最终使用了这样的嵌入式样式

<apex:inputfield value="{!Country__c.Full_Name__c}" style="width:400px"/>

您应该能够使用css实现这一点。几乎所有Visualforce标记都有一个名为styleClass的属性,该属性是要使用的css类的名称,即:

<apex:inputText styleClass="myClass" ... />

不用担心,很高兴能帮上忙!只要这对您有效,就可以使用它,但请注意,当您使用大量内联样式时,维护可能会变得很痛苦!
<input type="text" class="myClass" ... />
<apex:page standardController="Contact">
    <style type="text/css">
        .myClass { width: 400px; }
    </style>

    <apex:form >
        <apex:outputLabel for="firstName" value="First Name"/>
        <apex:inputText styleClass="myClass" id="firstName" value="{!Contact.FirstName}"/>
    </apex:form>
</apex:page>
input[type="text"].myClass = { width: 400px; }