[Resolved] Help with CSS (space between languages in drop-down list)
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is using the [wpml_language_selector_widget] shortcode to place a language switcher on their site and wants to increase the space between the languages in the dropdown list. The padding CSS property is not providing the desired effect. Solution: We recommend adding custom CSS to target the language switcher items directly. Here is the CSS code that should be added to the custom CSS section of the theme:
.wpml-ls-statics-shortcode_actions a {
padding-top: 18px !important;
padding-bottom: 18px !important;
padding-left: 15px !important;
}
Hello,
I have a rather simple question but can’t find the answer. I use shortcode [wpml_language_selector_widget] to place language switcher and trying to stylize it in the Language switcher options, Additional CSS. My problem is the languages in the drop-down list are too close to each-other. I need to increase the space between them and padding doesn’t help:
Thank you for contacting WPML Support. I’ve tried to visit your site but it seems your site is coming soon mode that’s why I can’t see the language switcher.
I just added the WPML language switcher with the [wpml_language_selector_widget] shortcode on my test site and I’m able to add the space between items by using the below CSS:
.wpml-ls-statics-shortcode_actions .wpml-ls-sub-menu a {
padding: 20px 5px;
}
In the custom CSS section of the theme and now it looks as in the attached screenshot. Could you please try to use the above CSS and see if this resolves your issue.
If the issue still persists, could you please try to disable the coming soon mode for a moment so that I can access to your site and provide you with correct CSS according to your site.
Hello, thank you for the code. It helped to increase the space between languages, but I also need to increase the padding top and bottom of the first item so it would look the same size as the sub-menu items. Also some padding to the left. I have enabled the site.
This is very helpful, thank you very much for your support!
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.