DEV Community

Omri Lotan
Omri Lotan

Posted on • Originally published at Medium on

Rich HTML in GitHub README

Embed rich HTML in any Markdown document, even a GitHub readme using foreignObject.


Jump to the example below to create a rich HTML document enveloped in an SVG file.

Readme frenzy

With the new GitHub profile readme feature, rich readme files with personal banners and customised messaging have become real popular. But Markdown, especially GitHub markdown is limited, and us snowflakes want to display our uniqueness in code! We don’t want animated GIFs, what is this, GeoCities? We want a way to incorporate rich, styled HTML in your readme files.

This could be live HTML

Enter foreignObject

<foreignObject> is an SVG element which can include elements from different XML namespaces. So, if our main XML namespace is SVG (, it can contain XHTML (, and all the features it supports, including a style tag.

Then, all that’s left is to include this an as image in your readme

# Welcome, I've been expecting you.
Enter fullscreen mode Exit fullscreen mode

Following is an example of an SVG file with embedded HTML document featuring CSS styles

Go nuts, create amazing things with HTML and CSS to enrich your readme and show off your wicked skills.

isbot readme banner
The banner from isbot repo. It even blinks

Top comments (1)

alibasiccoder profile image