Fixing Otter Blocks Icon List Alignment Issues
Content
If you're using the Otter Blocks Icon List and find that your icons and text become misaligned when an entry wraps to a second line, you're not alone. This is a common styling issue reported by users. This guide will explain why it happens and provide a tested CSS solution to fix the vertical alignment.
Why Does This Alignment Issue Happen?
The misalignment occurs due to the default CSS flexbox properties applied to the icon list items. When the text within a list item is long enough to wrap to a second line, the default alignment can cause the icon and the text baseline to become misaligned, breaking the visual consistency of the list.
How to Fix the Icon List Alignment
The most effective solution is to add custom CSS that overrides the default styles. Based on community reports and suggested fixes from the Otter Blocks team, the following code has proven successful for many users.
- Navigate to your WordPress Dashboard.
- Go to Appearance > Customize.
- Open the Additional CSS section.
- Copy and paste the following CSS code into the editor:
.wp-block-themeisle-blocks-icon-list:not(.is-style-horizontal) .wp-block-themeisle-blocks-icon-list-item {
min-height: 45px;
}
.wp-block-themeisle-blocks-icon-list .wp-block-themeisle-blocks-icon-list-item {
align-items: start;
}
.wp-block-themeisle-blocks-icon-list .wp-block-themeisle-blocks-icon-list-item i {
text-align: start;
}
- Click Publish to save your changes.
What This Code Does
- min-height: 45px; ensures each list item has a minimum height, providing consistent space for the icon and text.
- align-items: start; aligns the icon and text to the start of the flex container, which is crucial for proper vertical alignment when text wraps.
- text-align: start; ensures the icon itself is aligned correctly within its container.
Testing the Fix
After applying the CSS, clear any caching plugins you might be using and refresh the page containing your icon list. Check the alignment on both desktop and mobile views to ensure the text is now properly vertically aligned with the icon, even when it wraps to multiple lines.
Need Further Help?
If the issue persists after applying this code, it's possible your theme or another plugin is applying conflicting styles. You can try using your browser's inspector tool to identify other CSS rules that might be affecting the icon list. For more complex scenarios, you may need to adjust the CSS values (like the min-height) to better suit your specific design.
Related Support Threads Support
-
Otter generated CSS fileshttps://wordpress.org/support/topic/otter-generated-css-files/
-
Otter Accordion as Koshchey Immortal or Reborn Phoenixhttps://wordpress.org/support/topic/otter-accordion-as-koshchey-immortal-or-reborn-phoenix/
-
Templates are Missinghttps://wordpress.org/support/topic/templates-are-missing/
-
Problem with version 10.6.0 of Gutenberg pluginhttps://wordpress.org/support/topic/problem-with-version-10-6-0-of-gutenberg-plugin/
-
Editing page drops Custom CSShttps://wordpress.org/support/topic/editing-page-drops-custom-css/
-
Unique identifier characters being appended to svg filenames in media libraryhttps://wordpress.org/support/topic/unique-identifier-characters-being-appended-to-svg-filenames-in-media-library/
-
Animations with Neve Themehttps://wordpress.org/support/topic/animations-with-neve-theme/
-
CSS Optimization problemhttps://wordpress.org/support/topic/css-optimization-problem-2/
-
OtterBlocks Icon List Icon Alignmenthttps://wordpress.org/support/topic/otterblocks-icon-list-icon-alignment/
-
use the otter-blocks for the creation of a special purpose-blockhttps://wordpress.org/support/topic/use-the-otter-blocks-for-the-creation-of-a-special-purpose-block/
-
“Get Otter Pro” breaks admin editing viewhttps://wordpress.org/support/topic/get-otter-pro-breaks-admin-editing-view/
-
Otter notification can’t be removedhttps://wordpress.org/support/topic/otter-notification-cant-be-removed/
-
Add the essential “rem” and “em” units for font-size, padding and marginshttps://wordpress.org/support/topic/add-the-essential-rem-and-em-units-for-font-size-padding-and-margins/
-
Otter used with astra breaks the widgetshttps://wordpress.org/support/topic/otter-used-with-astra-breaks-the-widgets/
-
How to disable Otter’s AI Block?https://wordpress.org/support/topic/how-to-disable-otters-ai-block/
-
Otter Block Patterns are interfering with Gutenberg Interfacehttps://wordpress.org/support/topic/otter-block-patterns-are-interfering-with-gutenberg-interface/
-
OtterBlock breaks The Event Calendarhttps://wordpress.org/support/topic/otterblock-breaks-the-event-calendar/
-
Latest update adds 20px gap between sectionshttps://wordpress.org/support/topic/latest-update-adds-20px-gap-between-sections/
-
Automatic Migration for Button Styling Issues After Upgrading Otter blockshttps://wordpress.org/support/topic/automatic-migration-for-button-styling-issues-after-upgrading-otter-blocks/
-
otter-animation-css was added to the iframe incorrectly. Please use block.json ohttps://wordpress.org/support/topic/otter-animation-css-was-added-to-the-iframe-incorrectly-please-use-block-json-o/
-
Otter Flip Card Block not showing once publishedhttps://wordpress.org/support/topic/otter-flip-card-block-not-showing-once-published/
-
too much Minimal impact on memory usage ?https://wordpress.org/support/topic/too-much-minimal-impact-on-memory-usage-9/
-
Otter Template Libraryhttps://wordpress.org/support/topic/otter-template-library/
-
Current bugs when used in widgets (Popup, Dynamic vaules)https://wordpress.org/support/topic/current-bugs-when-used-in-widgets-popup-dynamic-vaules/
-
Why does the Pinterest Button of the otter sharing icons not work?https://wordpress.org/support/topic/why-does-the-pinterest-button-of-the-otter-sharing-icons-not-work/
-
creating featured images with the Otterblocks – see examplehttps://wordpress.org/support/topic/creating-featured-images-with-the-otterblocks-see-example/
-
SVG icons to improve performancehttps://wordpress.org/support/topic/svg-icons-to-improve-performance/
-
where is the template libraryhttps://wordpress.org/support/topic/where-is-the-template-library/
-
Some suggestions to make “Otter” even more competitive…https://wordpress.org/support/topic/some-suggestions-to-make-otter-even-more-competitive-2/
-
Integrate RankMath with Otterhttps://wordpress.org/support/topic/integrate-rankmath-with-otter/
-
Version 2.0/2.0.1 Hide Padding/Margin Valueshttps://wordpress.org/support/topic/version-2-0-2-0-1-hide-padding-margin-values/
-
Otter Plug-In Flip Card does not show full texthttps://wordpress.org/support/topic/otter-plug-in-flip-card-does-not-show-full-text/
-
Can I disable Otter snackbar notices?https://wordpress.org/support/topic/can-i-disable-otter-snackbar-notices/
-
Background Imageshttps://wordpress.org/support/topic/background-images-46/