HTML Filtering & CSS inline styling

I want to use some inline CSS styling on an image in a Simple Page with the code

<img style="display:block;margin-left:auto;margin-right:auto;"...

All the styles are preserved if I disable HTML Filtering in Settings > Security. If I enable HTML Filtering the margin-left & margin-right are preserved but the display:block is stripped.

What extra text do I need to enter in Allowed HTML Elements / Attributes in order to preserve the display:block styling with HTML Filtering enabled?

Grateful for any help. - thank you.

The problem is that HTML Purifier is parsing and filtering the CSS within the attribute, so there isn’t anything you can set for those settings to allow more CSS properties that aren’t currently being allowed. There is a setting that should allow it, the "CSS.AllowTricky` option for HTMLPurifier, but we don’t have a way for you to set that through the UI.

Thanks for reply, Would you say there are two aternatives then - to switch off HTML filtering or add styles to the main stylesheet?

How risky is switching off HTML filtering and what kind of problems does having it on prevent? I’ve read the info in the Omeka Classic User Manual but am not clear…