I am wondering how I can apply css to center labels of file uploads and signatures.
I am able to style the labels and .cf-labels, but I can't figure out how to get the labels centered.
I am wondering how I can apply css to center labels of file uploads and signatures.
I am able to style the labels and .cf-labels, but I can't figure out how to get the labels centered.
Great! And thank you for updating the tags on your post.
In the Forms Layout Designer, most (or all) of the field components have their display set to Flex. When display is set to Flex, then we can can use align-items and justify-content to change the alignment of the components.
I just tested this in Forms Layout Designer Version 11.0.2212.30907 and it worked to center the labels above the File Upload Field(s) and the Signature Field(s).
fl-file-upload label {align-items: center; justify-content: center;} fl-signature label {align-items: center; justify-content: center;}
This should be doable - but it is going to be different based on whether you are using the "Classic Form Designer" or the "Forms Layout Designer". You didn't tag you post with which one you are using. So which one are you using?
Great! And thank you for updating the tags on your post.
In the Forms Layout Designer, most (or all) of the field components have their display set to Flex. When display is set to Flex, then we can can use align-items and justify-content to change the alignment of the components.
I just tested this in Forms Layout Designer Version 11.0.2212.30907 and it worked to center the labels above the File Upload Field(s) and the Signature Field(s).
fl-file-upload label {align-items: center; justify-content: center;} fl-signature label {align-items: center; justify-content: center;}
Thanks!
You're very welcome.
By the way - if you're curious what the options are doing. Flex display (or Flexbox display) allows the items to be displayed as either a row or a column - and that's why CSS like text-align doesn't work in a Flexbox. justify-content: center is saying to center the item horizontally when displayed as a row, or vertically when displayed as a column. align-items: center is saying to center the item vertically when displayed as a row or horizontally when displayed as a column. Since the row is the same height as the label (or column the same width as the label) then align-items isn't really necessary, but it also doesn't hurt to have it.
Could you upload a picture of what your form looks like so I could provide more accurate CSS for you?
In the meantime, the classes have changed in the layout designer. If you inspect the HTML you'll notice the labels have a new class 'field-label' and the labels are in a flexbox. In order to align the text in the center of a flexbox, you can use 'justify-content: center;'
You will want to limit the scope of this CSS to just the fields that you want centered, and that requires either adding a class to the elements you want to center. Or adjusting your CSS selectors to only work on the signature and file upload fields.