Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I color text in GitHub's flavoured Markdown?

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>
like image 294
Abhishek093 Avatar asked Oct 08 '15 13:10

Abhishek093


People also ask

How do you add color to text in Markdown?

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{}{} .

Does GitHub Markdown support color?

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.

How do I change the color of my text in GitHub readme?

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.

Does Markdown support text color?

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.


1 Answers

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)

like image 94
Ionică Bizău Avatar answered Nov 07 '22 23:11

Ionică Bizău