-
AuthorPosts
-
September 13, 2017 at 12:26 am #851287
Hello
I’ve been looking at many posts and trying to make this work without bothering you and I think I’m close but can’t get it right.
I have been able to add a nice icon to the left as a default and am using just one page to test adding an image instead. For some reason if I remove the ‘conent’ settings the image also disappears. It seems that perhaps the background image needs something in content ot work. I have moved the psecific page icons over otherwise they all appear in the same place as the default for all pages. My code –
#avia-menu > li { padding:0 10px 0 10px; } /* all main menu items */ #avia-menu > li > a .avia-menu-text:before { /* right arrow */ content:'\E897'; font-family: 'entypo-fontello'; font-size: 20px; position: absolute; left: 0px; } /* building page */ #menu-item-305 > a::before { content:'\E824'; font-family: 'entypo-fontello'; font-size: 20px; position: absolute; left: -50px; opacity: #fff; background-image: url(/images/arrowRightGold.svg); background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; }
What I’m trying to do is have the just the gold image of the right arrow show up to the left of the text, and without the lock icon for the building page as a test it just disappears. I’ve tried a min-width and a few other options but as soon as I remove the ‘content’ element the background image also disappears. Please advise and thank you in advance :)
September 13, 2017 at 2:22 am #851312I’ve just changed the link in private so that Google doesn’t find it – please see below :)
September 13, 2017 at 2:42 am #851314Sorry, I had to revert the published page to a draft – it was showing up on the live site in Chrome! The access info is in private of you need it :)
September 14, 2017 at 7:15 am #851868Hi,
Thank you for using Enfold.
I can’t see the menu items. Could you please provide a screenshot of the issue?
Best regards,
IsmaelSeptember 14, 2017 at 9:02 pm #852301Sorry, I had to move a clone to a new dev area and hide this on the live teaser site, and I’m waiting for a sub domain instead. I’ll send you another link as soon as possible! :)
September 15, 2017 at 12:59 am #852361Ok, so now I have a clone in a dev sub domain. You will see that I’ve targeted just the menu item that is for the building page, and moved it over to the left and you’ll see a lock icon over an image of a gold arrow. I’d like to have just the gold arrow but when I remove the ‘content’ lines there is nothing to size the arrow. thanks again and please advise :)
/* building page */ #menu-item-312 > a::before { /* when I comment out the content icon the background image also disappears*/ content:'\E824'; font-family: 'entypo-fontello'; font-size: 20px; position: absolute; left: -50px; opacity: #fff; background-image: url(/images/arrowRightGold.svg); background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; }
September 15, 2017 at 1:04 am #852363Sorry, that should be color: #XXX, not opacity: #fff – I was just trying to hide it and got the two combined….
September 15, 2017 at 10:54 am #852483Hi,
Thank you for the info. :eave the “content” property blank then apply a width and height property to it.
Best regards,
IsmaelSeptember 16, 2017 at 8:59 pm #852943Ok, thanks so much! I moved the code to now include all the menu items since it’s looking great, so I’m sharing my code for others –
/* static */ #avia-menu > li { padding:0 10px 0 10px; } #avia-menu > li > a .avia-menu-text:before { content:' '; width: 15px; height: 15px; position: absolute; top: 46%; left: 0px; background-image: url(/images/arrowRightGrey.svg); background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; } #avia-menu > li > a { /* grey */ color: #5f6164 !important; } /* hover */ #avia-menu > li:hover > a .avia-menu-text:before { background-image: url(/images/arrowRightGold.svg); } #avia-menu > li:hover > a { /* gold */ color: #c6a762 !important; } /* active */ #avia-menu > li.current-menu-item > a .avia-menu-text:before { background-image: url(/images/arrowRightGold.svg); } #avia-menu > li.current-menu-item > a { /* gold */ color: #c6a762 !important; }
September 16, 2017 at 11:26 pm #852972 -
AuthorPosts
- The topic ‘Add svg icon before main menu items’ is closed to new replies.