0

I need to know if it's possible to load text from a TXT file with the CSS "content" attribute? I searched around and didn't find anything.

I have the following CSS:

.custom div.ot-loginPageCopyright::after {
    content: url('copyright.txt');
    text-indent: 0;
    display: block;
    line-height: initial;
}

The browser does request and download the .txt file, but nothing is displayed. It will display the text when it is a string literal in the CSS, but I was hoping to have some copyright information stored separately from the CSS in a text file, in case it needs to be updated, you could just update the text file without touching the CSS.

Note: I know how to do this via JS, but this has to be done via CSS, as no changes can be made to the HTML or JS. So please: no comments suggesting that this should be done in some other way except CSS (if it's possible).

Thanks!

  • 1
    So far no, that might pose a security risk. You can however add an SVG as the copyright text. This might help: https://stackoverflow.com/a/37558030/3130549 – rawnewdlz Feb 14 '20 at 20:46

1 Answers1

0

Thanks for the comment @rawnewdlz! I saw the hack for using a SVG, but I was wondering if it was at all possible feeding in a text file into the content, which is not possible.