Welcome! » Log In » Create A New Profile

Allow certain CSS properties

Posted by elindydotcom 
Allow certain CSS properties
August 02, 2017 07:30PM


I just picked up this tool and can understand how to use it to restrict data to just the html tags I want. But most of the CSS tags seem to be stripped when I do that. Its not quite obvious from the docs how to retain certain basic CSS items such as color.

If someone can point me in the right direction it would be really appreciated.


Re: Allow certain CSS properties
May 18, 2018 04:17PM

Post your config and it will be possible to help. Probably you didn't say that "style" attribute is allowed on the HTML tags you allowed.

Your Email:


HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

Place code here

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}