Home  >  Q&A  >  body text

How can I add this css in readme.md?

How to use this effect in readme.md file?


<h1>Welcome</h1>
h1 {
    background-image: url(./image.gif);
    background-size: cover;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

This is what I get when I write the html and css directly in the readme file Readme screenshot

P粉696605833P粉696605833191 days ago338

reply all(1)I'll reply

  • P粉670838735

    P粉6708387352024-04-01 15:15:32

    You just need to surround the CSS with tags.

    Should render correctly with most Markdown parsers.

    Welcome

    Unfortunately, on GitHub.com, this trick doesn't work. This is due to their sterilization process. "HTML has been sanitized to actively remove content that may harm you and your relatives, such as script tags, inline styles, and class or id attributes."

    to know more information:

    https://github.com/orgs/community/discussions/22728

    https://stackoverflow.com/a/51956450/16512927

    reply
    0
  • Cancelreply