Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Span element in Markdown

Tags:

html

css

markdown

I wrote a markdown.md with the following lines of code.

<span style="font-family: Open Sans; font-weight: 300; font-size: 16px; font-style: normal">300 Light normal hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 300; font-size: 16px;font-style: italic">300 Light italic hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 400; font-size: 16px; font-style: normal">400 Regular normal hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 400; font-size: 16px;font-style: italic">400 Regular italic hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 600; font-size: 16px; font-style: normal">600 Semibold normal hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 600; font-size: 16px;font-style: italic">600 Semibold italic hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 700; font-size: 16px; font-style: normal">700 Bold normal hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 700; font-size: 16px;font-style: italic">700 Bold italic hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 800; font-size: 16px; font-style: normal">800 ExtraBold normal hamburgefonstiv</span>
<br /> <span style="font-family: Open Sans; font-weight: 800; font-size: 16px;font-style: italic">800 ExtraBold italic hamburgefonstiv</span>

When I open the browser I see this. It works fine. When I open the the markdown.md on Github I see only the textlines as normal text. What is wrong? Is the idea with a span element the right one?

enter image description here

like image 221
Aaron Avatar asked Jul 03 '26 08:07

Aaron


1 Answers

Although GitHub's markdown spec supports some HTML, CSS is not supported at all at this time. See here:

GitHub strips style tags and attributes preventing you from changing the style on their pages. This is probably for security reasons. If you could inject css into GitHub pages, you could easily launch a phishing attack.

like image 71
jdgregson Avatar answered Jul 05 '26 20:07

jdgregson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!