I am trying to color a block of text which needs to be included in an article in a Git repository which is accessible to people. I am trying to color a word to bring the desired effect. Is there a way to use CSS styles to color the text since GitHub doesn’t support the styles anymore?
Currently, I am using the code below which doesn’t work in GitHub.
<center> <h1>2014, The year of <span style="color:red">Red</span></h1> </center>
The Markdown syntax has no built-in method for changing text colors. We can use HTML and LaTeX syntax to change the formatting of words: For HTML, we can wrap the text in the <span> tag and set color with CSS, e.g., <span style="color: red;">text</span> . For PDF, we can use the LaTeX command \textcolor{}{} .
On the app, I have selected GitHub Flavored in the Markdown options. According to GitHub, colors are allowed. I created a small text file as a test. I will show the code and how I expect it to look in the graphic below.
To do this just add tags such as these samples to your README.md file: ```json // code for coloring ``` ```html // code for coloring ``` ```js // code for coloring ``` ```css // code for coloring ``` // etc. No "pre" or "code" tags needed.
Markdown doesn't support color but you can inline HTML inside Markdown, e.g.: <span style="color:blue">some *blue* text</span>. As the original/official syntax rules state (emphasis added): Markdown's syntax is intended for one purpose: to be used as a format for writing for the web.
There is no such feature available right now. An alternative could be to color it in blue using links:
# 2014, The year of [Blue](#)
That would create the following output:
If you really want to have another color, another alternative is to use an image (e.g. like this one).
Then you can include it like below:
# 2014, The year of ![](https://cloud.githubusercontent.com/assets/2864371/10368192/cad27ed0-6ddc-11e5-8150-4f9c14ab9602.png)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With