Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#637 closed defect (invalid)

Xinha keeps removing styles

Reported by: wangs.chung@… Owned by: gogo
Priority: high Milestone:
Component: Xinha Core Version: trunk
Severity: normal Keywords:


Hi guys,

Lovin Xinha at the moment, but there is a small problem, the content which gets posted by my form, no longer has any CSS in the style tags.

Is there a fix?

Change History (2)

comment:1 Changed 15 years ago by wymsy

  • Resolution set to invalid
  • Status changed from new to closed

First, note that <style> tags should be used only in the <head> and not within the <body> of an html document.

In my tests using Firefox 1.0, I found that if I put style tags in the body, they were posted and saved in my database, but when I reloaded the page in Xinha they were removed during the load process. I then switched Xinha to full-page mode and found that style tags entered in the head section were preserved, and style tags entered in the body were moved into the head (where they belong)! This is being done by Firefox when it builds the DOM from the html, not by Xinha.

Bottom line, if you want to use style tags in Xinha, use full-page mode and put them in the head.

comment:2 Changed 15 years ago by anonymous

I wrap my css in <comment></comment> and then on the output to the browser replace <comment> with <style type="text/css"><!-- and </comment> with --></style>

Works for me :)

Note: See TracTickets for help on using tickets.