Recent

Author Topic: TIpHtmlPanel and CSS [solved]  (Read 207 times)

Manlio

  • Jr. Member
  • **
  • Posts: 95
  • Pascal dev
TIpHtmlPanel and CSS [solved]
« 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!
« Last Edit: July 26, 2020, 01:44:39 am by Manlio »
manlio mazzon gmail

Manlio

  • Jr. Member
  • **
  • Posts: 95
  • Pascal dev
Re: TIpHtmlPanel and CSS
« Reply #1 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">
manlio mazzon gmail

 

TinyPortal © 2005-2018