Recent searches
No recent searches
dropdown not aligned with label in zendesk form
Answered
Posted Feb 05, 2024
Hi, I have challenge to update my request custom field (multi-select) to allow left alignment.
i have adjust in style.css the width as below :
#request_custom_fields_28159647845273{
width: 500px
}
But when hover to the multi selection, the width is way too ugly and it is on the right alignment.
I have very least knowledge in style.css or script.js
anyone can help me ?
0
3
3 comments
Brandon Tidd
Hey Joanne,
I haven't personally tested this, but to adjust the alignment and appearance of the multi-select dropdown in your CSS, you will need to target the element more specifically and set properties that control its position and size. Since the dropdown is likely absolutely positioned by default, you will need to adjust its `left` property to align it with the left edge of the container.
Here's an example of how you might adjust your CSS:
You will need to replace `.multiselect__content-wrapper` with the actual class used by the dropdown. If you are not sure of the class, you will need to inspect the element using your browser's developer tools to find the correct class or ID to target.
Since you mentioned having limited knowledge of CSS, here's a quick rundown of what each property does:
- `width`: This property sets the width of an element.
- `left`: When used with `position: absolute;`, this property sets the left edge of an element at a specified distance from the left edge of its containing element.
Please keep in mind that the actual class names may vary based on the platform or framework you are using. If you're unsure, inspecting the element in your browser's developer tools and looking for the dropdown or multi-select related elements will give you the specific classes or IDs you need to target.
If you want to ensure that the dropdown does not exceed the boundaries of a parent element, you may need to set `position: relative;` on the parent element so that the `left` property of the dropdown is relative to the parent.
If this doesn't resolve your issue, or if the styles are being overridden somewhere else, you might need to use more specific CSS selectors or use `!important` to enforce the styles, though using `!important` is generally discouraged unless absolutely necessary.
Lastly, if the styles are added dynamically via JavaScript and you have control over the script, you might want to adjust the script that generates the styles to include the correct width and alignment.
Hope this helps!
Brandon
0
Joanne Kow
Hi Brandon,
I am really not good on all this.... for me to to replace `.multiselect__content-wrapper` with the actual class used by the dropdown.
It seems i am not able to find the class ID.
Can enlighten me more... ?

0
Brandon Tidd
Hey Joanne,
No worries at all - we're all here to learn & grow!
If you're looking to customize or specifically target multi-select fields using CSS or To identify the specific class or ID, you would:
1. Inspect the form element in your browser (using the browser's Developer Tools) to see the generated HTML structure.
2. Look for the `select` element with the `multiple` attribute. This indicates a multi-select field.
3. Note any unique classes or IDs. Zendesk might use specific classes that start with `zd-` or similar prefixes, but these can change based on Zendesk's internal updates.
For custom styling or functionality, you might find something like this in the HTML:
In this example, `request_custom_fields_12345` is the ID of the multi-select field, where `12345` is a placeholder for the actual custom field ID in your Zendesk instance. You could target this field in CSS or JavaScript using its ID or the `c-select` class along with the `multiple` attribute to specifically identify multi-select fields.
For CSS customization, targeting the ID would look like this:
Or, to generally target all multi-select fields, you could use:
Keep in mind that direct modifications to the theme or custom JavaScript/CSS injections should be done cautiously to avoid breaking form functionality or causing unexpected behavior, especially since Zendesk periodically updates their platform and themes.
Hope this helps!
Brandon
0