using a css class inside PHP -
I have to set this function, which exits a custom field in a WordPress article editor. It works and displays the editor I am inserting (like 20,00)
but I can not use it CSS
& lt; Div class = "value" & gt; & Lt; P & gt; & Lt ;? Php Echo '& lt; Div class = "price" & gt; Get_post_meta (get_the_ID (), 'value', true). '& Lt; / Div & gt; '; ? & Gt; € & lt; / P & gt; & Lt; / Div & gt;
This is my CSS file:
.price {font-size: 50px; Color: # 8e8e8e; }
Why does not the CSS code apply?
CSS is not different than any other CSS implemented with PHP. This is not a problem.
This is probably the case of some other CSS which is overriding your definition for more specific selector .price
. Also, make sure the path to your CSS file is correct and the code is loading. To diagnose it, load the script into your browser and use the code inspector to see the div
with the .price
class. This will show you all the CSS applicable to the element and you will be able to see if the rules of your .price
class are being applied and if they are overriding with another rule.
Know your Code Inspector - Firebox is a valuable add-on for Firefox, and a decent inspector has been built in Chrome. It is a powerful tool to remove styling problems among other things.
Comments
Post a Comment