search

Home  >  Q&A  >  body text

Reasons why CSS font-size remains unchanged

.navbar-brand{
  font-weight: bold;
  font-family: "Ubuntu";
  font-size: 2.5rem;
}
<a class="navbar-brand" href="">tindog</a>

This is how I tried to change the font size of a link through some class and I ran into something weird, both the font family and the font weight, everything changed, meaning that I defined the The class index.html is correct and in the css file I did it correctly! But the size didn't change, someone explained to me what could be the problem. Thanks! !

P粉986028039P粉986028039266 days ago495

reply all(1)I'll reply

  • P粉022140576

    P粉0221405762024-04-01 07:00:07

    I tested your code and there is no problem. Try using pixels to change the font size.

    .navbar-brand {
    font-weight: bold;
    font-family: "Ubuntu";
    font-size: 40px;
    }

    Since 1rem = 16px.

    reply
    0
  • Cancelreply