4

I have this line in my code:

<label style="font-weight: bold" for="sedii18n_codice_paese_indirizzo">Codice paese indirizzo</label>

but the label is showed normal.

If I go to the Chrome Inspector I can see this:

font-weight: normal !important;

If I change font-weight in the inspector the weight of the font is modified normally.

TylerH
  • 20,799
  • 66
  • 75
  • 101
tirenweb
  • 30,963
  • 73
  • 183
  • 303
  • If there are multiple CSS files linked on the page, it is possible that they are in the wrong order. If I remember correctly, the stylesheet rules that are defined higher up in a page take precedence over those defined later. Reordering the stylesheets may help or may make other rules mess up. Depends how you have structured them – Ren Nov 03 '12 at 20:34
  • Possible duplicate of [How to style a select tag's option element?](http://stackoverflow.com/questions/5887133/how-to-style-a-select-tags-option-element) – TylerH Nov 29 '15 at 23:41

3 Answers3

11

Looks like something else is overriding your bold style, hence the !important tag. Chrome Inspector should tell you where the font-weight: normal !important; is being applied. You can try putting font-weight: bold !important; inside your style attribute to override this override. :-)

Jez
  • 27,951
  • 32
  • 136
  • 233
  • 1
    The solution given by Jez should already work on any browser - the problem is not specifically Chrome. The best thing is probably to find out what's applying the `font-weight: normal !important;` in the first place, and see if you can remove it. – Matt Sach Oct 18 '10 at 16:07
2

have you take a look on the top right corner of your active element in the inspector?

You can find which stylesheet is overwriting you code

Patrick Ferreira
  • 1,983
  • 1
  • 15
  • 31
0

You can create a separate .css file for label tag and mention it as below: -

.lbl { font-weight : normal; }

Inside html file: -<label class = "lbl" for="sedii18n_codice_paese_indirizzo">Codice paese indirizzo</label>

This is working for me as well as overridden in google chrome.

Sangram_2020
  • 99
  • 2
  • 11