Is it possible to give a <div> inside a post some custom styling?
I’ve seen that any non-whitelisted classes are stripped out, and I’ve tried addingstyle= to my divs and spans to no avail , so does anyone know if there’s a way to do that?
Basically I have a bot that posts from an internal tool and I’d like to have it post with something that looks like the tool to make it obvious that it’s not a regular disourse post, something like this:
It’s got a couple of nested divs/spans to make it look nice and they each have their own associated css.
Ideally if the bot could post something like this:
those extra classes would be specified in the global discourse css, but even if I could lump all my styling into style tags, that would solve my problem.
This might not be appropriate for dev, but I wasn’t sure where it should go as it’s not really theme-ing or plugin either! Please move if it’s in the wrong place
Ich habe den gleichen Code gerade ausprobiert, und bei mir funktioniert er einwandfrei. Versuchen Sie vielleicht Folgendes:
div[data-theme-bot] {
color: red !important;
}
Wenn das funktioniert, bedeutet das, dass an anderer Stelle eine CSS-Regel (aus einem Theme, einer Komponente oder einem Plugin) spezifischer war als dieser Stil und ihn daher überschrieben hat.
Du hast recht. Ich glaube, ich hatte ein Cache-Problem in meinem Browser.
Dieser Trick ist ein wichtiger Baustein, um meine WordPress-Beiträge in Discourse zu veröffentlichen und dabei ein Erscheinungsbild zu erzielen, das der WordPress-Version ähnelt.