0

I am retrieving body text from the database in phpmyadmin. To remove the html entities I have written the following code:

<h4><?php echo html_entity_decode($post['body']); ?></h4>

However by adding the 'html_entity_decode', this reduces the font size significantly in smaller screens but goes back to normal when the decode is removed. How can I fix this?

p.s - I have tried overriding the h4 in css with an !important tag as well for smaller screens but nothing works. Thanks.

gilesj
  • 1
  • 6
  • 2
    You should post this as a CSS issue where you show the generated HTML and your CSS that you say doesn't work. All `html_entity_decode()` does is converting html entities back to the original html again. Where does the string originally come from? – M. Eriksson Jul 15 '20 at 09:14
  • 2
    PHP functions do not alter styles AFAIK. Your style must be coming from elsewhere. You can usually inspect the `

    ` and check the computed section, might give you a hint where it is coming from

    – meewog Jul 15 '20 at 09:14
  • The string comes from a form input value @MagnusEriksson. Sure, noted for next time – gilesj Jul 15 '20 at 09:39
  • 2
    I have now inspected the elements and the CSS style over riding all my other styles was nowhere to be seen which is baffling! So I just added that over riding CSS back into the stylesheet and now it works! Thanks @MehrdadDastgir – gilesj Jul 15 '20 at 09:39

0 Answers0