Indentation in Drupal 8 form I have a drupal 8 form as follows: 

   $form['extra_fields']['email'] = [
        '#type' =&gt; 'checkbox',
        '#options' =&gt; ['email' =&gt; 'email'],
        '#title' =&gt; $this-&gt;t('Email')
    ];

   $form['email']['required'] = array(
        '#type' =&gt; 'radios',
        '#default_value' =&gt; 0,
        '#options' =&gt; array(0 =&gt; $this-&gt;t('Required'), 1 =&gt; $this-&gt;t('Not Required')),
    );


which shows up as: 



I would like to have the radios a bit indented. Is it possible to achieve this? Also, how to make the radio buttons inline?

Thanks.
Assuming you built this form programmatically (custom module):

Wrap your radios field inside a class using #prefix and #suffix

   $form['email']['required'] = array(
        '#type' =&gt; 'radios',
        '#default_value' =&gt; 0,
        '#options' =&gt; array(0 =&gt; $this-&gt;t('Required'), 1 =&gt; $this-&gt;t('Not Required')),
        '#prefix' =&gt; '&lt;div class="indent"&gt;',
        '#suffix' =&gt; '&lt;/div&gt;',
    );


Use CSS to alter the look.

Create a CSS file.

my_module/css/myform.css


  a bit indented


.indent {
  margin-left: 10px;
}



  make the radio buttons inline?


.indent .js-form-type-radio {
  display: inline-block;
}


Create a library

my_module/my_module.libraries.yml

form-stuff:
  version: 1.x
  css:
    theme:
      css/myform.css: {}


Attach library to your form so it loads your CSS

$form['#attached']['library'][] = 'my_module/form-stuff';