Skip to content

GitHub Flavored Markdown doesn't render CSS styles inside a HTML block #22728

Discussion options

You must be logged in to vote

Hello @ZeroAurora,

Unfortunately you cannot use CSS in GitHub markdown as it is a part of the sanitization process.

The HTML is sanitized, aggressively removing things that could harm you and your kin—such as script tags, inline-styles, and class or id attributes.

source: https://github.com/github/markup

While CSS can’t be super malicious, one could create a number of nuisances with it, such as for example, an element that takes up the entire page and blocks user interaction. I admit it would be nice to use at least some styles for alignment and what not, but it’s understandable.

In regards to centering, the align attribute is the only method that will work currently. Despite being depr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bilogic
Comment options

@JaiS99
Comment options

@LevDoesCode
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Markdown GitHub-flavored Markdown requests, issues, and more New User Help ❓ New User help
5 participants