Blocs 6 make it a snap for me to FINALLY swap out that old Twitter bird icon with the X icon! I got my class setup so a mouseover makes it change color on mouseover. I have one placed in the footer and another in my mega menu in the header, on every page in my site.
PROBLEM: Within my mega menu, if I mouseover the X logo, the associated text to the right properly changes color (to WHITE). But if I mouseover the text, the X icon doesn’t also change color. That is the problem.
Here’s a link to my website so you can try it yourself:
To pull down the mega menu, open the URL above and then click once on the menu that looks like this:
Here’s an animated GIF screenshot of where the X logo is used on the right side of my Mega Menu:
You can see that the 4 items at the bottom each have icons: Instagram, X, FaceBook and YouTube.
In Blocs, each of those are Code Widgets:
The icon for Instagram, FaceBook and YouTube all come from FontAwesome. There is no X logo in FontAwesome used by Blocs 6, which is why I needed to resort to using an SVG.
What I did was to add the “X” SVG into my footer first. I then previewed in Safari and examined the page code. I then used that code inside my Code Widget for the Mega Menu:
<a href="https://x.com/Kiramek_Inc" class="a-btn a-block dropdown-links">
<blocsicon class="img-fluid x-svg-icon-header-menu">
<svg width="16" height="16" class="bi bi-twitter-x" viewBox="0 0 16 16">
<path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z"></path>
</svg>
</blocsicon>
(旧ツイッター)</a>
If you examine the code above, you will see a class named “x-svg-icon-header-menu”. That class was created by me to set the Size, Normal SVG Fill Color, and Hover SVG Fill Color of the “X” icon.
QUESTION: How do I change my Code Widget code to make the X logo (SVG) change color when I mouseover the text to the right of it? (Both are inside the “a” tag now, as you can see from my code above.)
Thank you.