Lazarus

Programming => Packages and Libraries => Lazarus Extra Components => Topic started by: Manlio on July 26, 2020, 01:33:43 am

Title: TIpHtmlPanel and CSS [solved]
Post by: Manlio on July 26, 2020, 01:33:43 am
I'm trying to display an HTML page with a TIpHtmlPanel, but I cannot get the CSS declared in a <style> tag to work.

For example, I load the following string with SetHtmlFromStr():

Code: Text  [Select][+][-]
  1. <html>
  2. <head>
  3.  
  4. <style>
  5. .bold { font-weight:bold; }
  6. </style>
  7.  
  8. </head>
  9. <body>
  10.  
  11. <p style="font-weight:bold;">Para 1, this becomes bold</p>
  12.  
  13. <p class="bold">Para 2, this does NOT become bold</p>
  14.  
  15. </body>
  16. </html>
  17.  

When loading the above, "Para 1" (with the inline style attribute) becomes bold as expected, but "Para 2" does not.

Is the <style> tag supported? Am I using it wrong? What should I do instead?

Any help will be greatly appreciated!
Title: Re: TIpHtmlPanel and CSS
Post by: Manlio on July 26, 2020, 01:43:28 am
OK, I found the error, instead of <style> I must use the full version:

<style type="text/css">
TinyPortal © 2005-2018