Font awesome sun icon not showing

<div class="search-wrapper">
<form action="" class="search-form">
</form>

<button class="dark-light-mode">
<i class="fa-sharp fa-regular fa-sun-bright"></i>
</button>
</div>
<div class="search-wrapper">
<form action="" class="search-form">
</form>

<button class="dark-light-mode">
<i class="fa-sharp fa-regular fa-sun-bright"></i>
</button>
</div>
.dark-light-mode{
outline: 2px solid red;
display: flex;
align-items: center ;
justify-content: center;
}
.dark-light-mode{
outline: 2px solid red;
display: flex;
align-items: center ;
justify-content: center;
}
18 Replies
Jochem
Jochem2y ago
how are you including font-awesome?
CodeNascher
CodeNascher2y ago
it's a paid icon
Avinash
Avinash2y ago
my bad, it indeed is a paid icon . Any recommended sites that is similar to font awesome?
Avinash
Avinash2y ago
where can i find cdn or similar link to link it to html?
Jochem
Jochem2y ago
That's not quite how icones works, you can download them as SVGs either individually or by selecting multiple and clicking the basket in the bottom right corner to download them as a zip of svgs or an iconfont
Jochem
Jochem2y ago
there's lots of options when you click an icon:
Avinash
Avinash2y ago
understood, if i use SVG path it becomes like a mess, is there a way to avoid this? i saw somewhere you can create a new file for svg icons, then import it to html . im not sure how it works but i read it somewhere
Jochem
Jochem2y ago
you can save them as svg files and reference them using an img tag, though it has some drawbacks: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Adding_vector_graphics_to_the_Web
Avinash
Avinash2y ago
so what would you recommend? download svg file or paste the entire path into HTML?
Jochem
Jochem2y ago
the URL button will also copy the URL for the icon to your clipboard, the DataURL would work with the url() function in CSS for the background-image attribute: https://developer.mozilla.org/en-US/docs/Web/CSS/url that's up to you. I'd put the icon in a svelte component and include it like that, but in vanilla HTML? I'd probably go with the dataurl option in my previous message, and put it in either a separate CSS file, or just in side my main one depending on where they're used and how many icons I have
Avinash
Avinash2y ago
something like this?? cause its not showing
Jochem
Jochem2y ago
are you including the css file? and is the button big enough to show the background?
Tenkes
Tenkes2y ago
I believe you're referring to what Kevin did in this video. Starting at 6:15 https://youtu.be/eX9JhQtMxCg
Kevin Powell
YouTube
Build a responsive website with HTML & CSS | Part seven: the footer
In this one, we look at setting up the footer, including creating some SVG sprites for our social icons and using CSS grid for the layout. 🔗 Links ✅ GitHub repo for where I start this video: https://github.com/kevin-powell/fem-manage-landing-page-part-6 ✅ The playlist of this series: https://youtube.com/playlist?list=PL4-IK0AVhVjNDRHoXGort7...
Avinash
Avinash2y ago
yeah its big enough. i kept same css styling and replaced svg in html to new css where i set background:url(dataURL)
Jochem
Jochem2y ago
did you add a link tag for the new CSS file?
Avinash
Avinash2y ago
yes
Jochem
Jochem2y ago
then I don't know what's wrong, it's hard to tell without seeing something more than screenshots
Want results from more Discord servers?
Add your server