mbenford Posted January 10, 2021 Share Posted January 10, 2021 Site URL: https://ferret-gold-86m7.squarespace.com/ I am seeking help as i have been at it for hours I have been trying to add a search icon to the header of my site using font awesome (open to other solutions if recommended) . I have tried 2 methods - adding it to the navigation with a :before pseudo however i had to have an actual navigation title so i just used a period so i didnt have to have the word search and just use the icon - not ideal). I used this code in the code injection header This CSS in trhe Custom CSS // ** Search icon in header. ** // .header-nav-item:nth-child(9) a::before { content: '\f002'!important; font-family: FontAwesome !important; display: inline-block; padding-right: 0px; } I thought htis worked until I checked it on mobile and shared it with a few colleagues to review, As seen in the screen capture i see it fine on desktop Chrome but it renders as a sqaufre on mobile and for other uses. I then found this solution in the forum for adding font awesome to the social icons in header. Same results - redners fine on my desktop but not on mobile or for other users. using the enclosed CSS // ** Search icon in header. ** // .header-nav-item:nth-child(9) a::before { content: '\f002'!important; font-family: FontAwesome !important; display: inline-block; padding-right: 0px; } thanks for any help you can provide. Link to comment
tazmeah Posted January 11, 2021 Share Posted January 11, 2021 It looks like you need to link the fontawesome stylesheet to your header code injection. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> Link to comment
mbenford Posted January 11, 2021 Author Share Posted January 11, 2021 12 minutes ago, tazmeah said: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> Thanks I really appreciate you responding- unfortunately it is still not showing up on mobile in either location (social links or nav) Link to comment
tuanphan Posted January 13, 2021 Share Posted January 13, 2021 If FA 4.7 doesn't work, try FA5. Or you can use CSS to insert search image, instead of FA icons Or use jQuery to add search image on header (i did this for a site last week) Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.