Design comparison
Solution retrospective
I was proud of completing a frontend project at this speed
Next time while defining the themes I would probably love to first create crap HTML and then add colors & padding to each element respectively that would enhance my speed
What challenges did you encounter, and how did you overcome them?I faced challenge while adding the local Inter font in the assets/fonts
directory using the @font-face
CSS rule
Couldn't get that working myself
Overcame it by pasting the CSS from FontSource CDN
What specific areas of your project would you like help with?I would appreciate if anyone could help me adding the @font-face
in CSS for local fonts
Community feedback
- @Alex-Archer-IPosted 5 months ago
Hi!
Basically to use
font-face
you need just two properties:@font-face { font-family: "FontName"; src: url("path/to/font.woff") type("woff"); }
I can't say why it didn't work in your case, but there are could be two reasons - wrong path or wrong type. As
font-face
can work withouttype
you can try to remove it. If the font will work, than thetype
was a problem, if not - try to change path.Oh, and a one semantic advice - it's a list of the links here, so it should be
ul
andli
.<ul> <li><a href="#">I'm a link!</a></li> ... </ul>
Hope that helps =)
1@RayyanNafeesPosted 5 months ago@Alex-Archer-I Thanks for the semantic list advice.. I just couldn't reset the default css for list items with those..
li::marker
css & default indentation so had to try the other wayThe challenges comes with a .ttf font and I added em this way
@font-face { font-family: "Inter"; src: url("./assets/fonts/Inter-normal,wght.ttf") type("ttf"); }
But.. upon adding them in CSS the font couldn't load
1@Alex-Archer-IPosted 5 months ago@RayyanNafees
Oh, at first, sorry, I mistyped - it's
format
, nottype
. And for thettf
fonts you should usetruetype
value.src: url("./assets/fonts/Inter-normal,wght.ttf") format("truetype");
Than, if you are using the same fonts files that provided with starter, there aren't such file as "Inter-normal,wght.ttf" there. It have three static fonts and they are in the
static
folder, so the path looks like this:src: url("./assets/fonts/static/Inter-Bold.ttf") format("truetype");
And one variable font which is just in the "fonts" folder. If you are trying to use variable font, than
format("truetype")
wouldn't work. Alas, I can't find appropriate format value forttf
fonts so, for now, I can only advice to omitformat
at all.And what about list - you can use
lyst-style: none
rule to remove markers at all.0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord