Reputation: 81
I am using mkdocs to create a static documentation, and I am using the rtd-dropdown theme. Does anyone know how to change the color of inline code using css for mkdocs?
Upvotes: 2
Views: 1700
Reputation: 3852
When your site has rendered in your browser you can:
<code></code>
line.color
In my case, the CSS selector is .md-typeset code
.
This means that if I want my inline code text color to be red
, I can put the following in my .css
file:
.md-typeset p > code {
color: red;
}
Note that p > code
means "all code inside p-tags", which selects inline code. Neglecting the p >
might result in code blocks being affected by the css as well. This is likely not what is desired.
You can of course use this to change other attributes like background-color
, font-family
, etc. as well.
I'm running MkDocs v1.1.2 with the Material theme.
Upvotes: 1