Forum > Lazarus Extra Components

TIpHtmlPanel and CSS [solved]


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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<html><head> <style>.bold { font-weight:bold; } </style> </head><body> <p style="font-weight:bold;">Para 1, this becomes bold</p> <p class="bold">Para 2, this does NOT become bold</p> </body></html> 
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!

OK, I found the error, instead of <style> I must use the full version:

<style type="text/css">


[0] Message Index

Go to full version