Search code examples
cssformswebformslabelinline

How to make form label and content inline?


I need to align label and content in a form but no code I tried worked.

Expected

enter image description here

currently look like

enter image description here

The css code I created is this:

.crm-webform, .crm-webform-label,  .crm-webform-fieldset, .crm-webform-input-label, .crm-webform-group, .crm-webform-input, .crm-webform-label-content  {font-family: Open sans, 'Open sans', Lato, sans-serif;   font-size:14px;   color:black; margin: 0px 0px 3px 0px; } 

.crm-webform-input {height: 32px; }  .crm-webform-icon  {height: 22px; line-height: 30px;}  #LEAD_UF_CRM_5BEF2B8E126AA  { padding:  1px 3px 1px 3px;  height:60px; resize: both;
  overflow: auto;} label[for=LEAD_UF_CRM_1550937652],  label[for=LEAD_UF_CRM_1550937755] {height:0px; color:transparent; opacity:0; margin: 0px 6px 0px 6px;}

.flexible-middle-width, .crm-webform-header-container {background-color:transparent; background-opacity:0.4;}

/*#bx_form_iframe_6 ,  .crm-webform-block  .bx_form_iframe_12       */   

.*, *  {background-color:transparent; background-opacity:0.4; font-family:Open-sans, Open sans, 'Open sans', Lato, sans-serif; color:black;   }

h1, .crm-webform-header {color:black; font-family:Open-sans, 'Open sans', Lato, sans-serif;  font-weight: bold; size:26px;  letter-spacing: 1px; margin: 6px 0px 0px 0px;}

.crm-webform-input {font-weight:600; }  .crm-webform-checkbox-container, .crm-webform-checkbox-radio,  .crm-webform-checkbox-name {display:inline; font-family:Open-sans,'Open sans', Lato, sans-serif;     font-size:14px;    color:black;  padding: 0px 4px 0px 9px;}  

Solution

  • If you set these attributes to this class .crm-webform-field-string (or create another class as well) it will work:

    .crm-webform-field-string {
        display: flex;
        align-items: center;
    }
    

    The rest is only to set a margin-right to the label container.

    For example:

    margin-right: 30px;