Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 :)

    #851312

    I’ve just changed the link in private so that Google doesn’t find it – please see below :)

    #851314

    Sorry, 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 :)

    #851868

    Hi,

    Thank you for using Enfold.

    I can’t see the menu items. Could you please provide a screenshot of the issue?

    Best regards,
    Ismael

    #852301

    Sorry, 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! :)

    #852361

    Ok, 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%; 		
    }
    
    #852363

    Sorry, that should be color: #XXX, not opacity: #fff – I was just trying to hide it and got the two combined….

    #852483

    Hi,

    Thank you for the info. :eave the “content” property blank then apply a width and height property to it.

    Best regards,
    Ismael

    #852943

    Ok, 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;
    }
    #852972

    Hi,
    Thank you for sharing your solution, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add svg icon before main menu items’ is closed to new replies.