Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client changed the language flags to a dropdown on their site, resulting in the dropdown's background being transparent and overlapping with the text. The client asked how to add a white background to this dropdown.
Solution:
We recommended adding specific CSS to the custom CSS section of the theme to resolve the issue. To add a white background to the language switcher dropdown, use the following CSS:

.wpml-ls-legacy-dropdown .wpml-ls-sub-menu {<br />    background: #fff !important;<br />}

If the client also needs to add a white background to the active language, they should use this additional CSS along with the above:

.wpml-ls-statics-shortcode_actions {<br />    background-color: #fff;<br />}

After applying the CSS, it's important to clear all types of site, server, and CDN caches. For more detailed instructions and troubleshooting, visit the documentation on how to fix styling and CSS issues for the language switchers.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Noman 1 month ago.

Assisted by: Noman.

Author Posts
April 11, 2025 at 11:09 am #16922324

Dimitrios Vasileiou

Background of the issue:
I changed the language flags to be a dropdown on my site hidden link.

Symptoms:
The background of the language flags dropdown doesn't have color and overlaps with the text.

Questions:
how to put white colour on the background?

April 13, 2025 at 8:22 am #16926121

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. If you need to add white background color to the language switcher dropdown then please add the below CSS in the custom CSS section of the theme and it will look as in the attached screenshot:

.wpml-ls-legacy-dropdown .wpml-ls-sub-menu {
	background: #fff !important;
}

If you need to add white background to the active language also, then please use the below CSS also with above CSS:

.wpml-ls-statics-shortcode_actions {
    background-color: #fff;
}

After using the above CSS, please clear all sorts of site/server/CDN cache and see if this resolves the issue.

Here is a doc for more details:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/how-to-fix-styling-and-css-issues-for-the-language-switchers/

Please let me know the results,
Thank you

1 - white color in dropdown only.jpg
2 - white color to whole language switcher.jpg