Home > OS >  Why CSS font-size doesn't change?
Why CSS font-size doesn't change?

Time:12-29

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

So this is how I try to change the font-size for my link through a certain class and I came across something strange that everything has changed whether it is font-family or font-weight which means that I define the class in index.html correctly and in the css file I am doing it right!! But the size does not change, someone explain to me what could be the problem. THANKS!!

CodePudding user response:

I tested your code and there is nothing wrong with it. Try to change the font size using pixels instead.

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

Since 1rem = 16px.

CodePudding user response:

Try this code:

.navbar-brand{
  font-weight: bold;
  font-family: "Ubuntu";
  font-size: 2.5rem !important;
}
  • Related