Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Need help for applying simple font-style

Praveen

New Coder
I've used some google fonts, let me show you some
HTML:
 <link rel="stylesheet" href="style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Sofia+Sans+Semi+Condensed:wght@400;700&display=swap" rel="stylesheet">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
As you can see I've tried to link two fonts which are "Sofia Sans Semi Condensed" and "Inter"
And I saved it in my css root variables like this

CSS:
:root{
    --paragraph-font: 'Inter', sans-serif;
    --heading-font:  'Sofia Sans Semi Condensed', sans-serif;
}

I"m trying to apply the font in navbar with a list like this and also in nav-logo-text
HTML:
    <nav>
    <div class="logo-section">
        <div class="nav-logo">
            <img src="./assets/asset 1.png" alt="" srcset="">
        </div>
        <div class="nav-logo-bubble">
            <div class="nav-logo-text">
                Become a tester
            </div>
        </div>
    </div>
    <ul>
        <li><a href="#">Product</a></li>
        <li><a href="#">Customers</a></li>
        <li><a href="#">Pricing</a></li>
        <li><a href="#">Resources</a></li>
        <li><a href="#">Sign in</a></li>
        <li><a href="#">Sign up</a></li>
    </ul>
    



    </nav>

and to target them with css, I used this code below!

CSS:
.nav-logo-text{
    color: #183b56;
    font-style: var(--heading-font);
    text-align: center;
    padding: 13px;
}


nav ul{
    display: flex;
    gap: 1.2rem;
    font-style: var(--heading-font);

}

But neither nav ul font's changing neither nav-logo-text
when I try inspect in firefox, it says invalid property
 
Back
Top Bottom