[SalesForce] slds-form-element_horizontal change distribution of label and field

Is it possible to change the distribution of the label (default is 33/66%) in a horizontal form?

enter image description here

How can I have these label inline without let them going to new line?

Best Answer

Can you try the below CSS which should place the label above the input fields.

<div class="slds-form-element slds-m-bottom_xx-small">
                                        <label class="slds-form-element__label" for="combobox-unique-id-2">
                                            <abbr title="required" class="slds-required slds-m-around_none">*</abbr>
                                            Ship From Plant
                                        </label>
                                        <div class="slds-form-element__control">
                                            <div class="slds-combobox_container serv-tableheader_textbox">
                                                <div class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-combobox-picklist" aria-expanded="false" aria-haspopup="listbox" role="combobox">
                                                    <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                                                        <lightning:inputField fieldName="Plant_Name__c" variant="label-hidden" aura:id="ShipFromPlant" required="true" value="{!v.shipFromPlantID}" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
Related Topic