0

I added this code right before the end of the body tag in the facebook.com page (not logged in):

<style>
  * {
    font-family: Times New Roman !important
  }
</style>

But some text of the website (including "Connect with friends and the world around you on Facebook.") didn't change. Why?

Nidhin Joseph
  • 9,981
  • 4
  • 26
  • 48

2 Answers2

0

Adding !important may not always work as expected. You also need to check the element level CSS as well. This is in accordance with the order of precedence for CSS.

See the example below which shows how precedence works in CSS.

* {
  font-family: Times New Roman !important;
  color: red !important;
}

.different {
  font-family: Arial, Helvetica, sans-serif !important;
  color: green !important;
}
<p>
  This is para 1
</p>

<p class="different">
  This is para 2
</p>
Nidhin Joseph
  • 9,981
  • 4
  • 26
  • 48
-3

You should add your style tag after the <head>.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
leilankn
  • 1
  • 1