Adding watermarks to markdown pages? #7365
-
Has anyone been able to apply watermarks or a semi-transparent image/text on markdown pages? I need to share a zipped version of my docs with a confidential watermark, similar to the image I've attached. Would this be something we'd use CSS and the content override for, or is this something I should ask in the MkDocs repo instead? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
One option would be to use a background image, which you could create as an SVG, for example, and you could use a drawing program to give it the slant and let CSS deal with the business of repeating it across the page. Have a look to see if this would work: .md-content .md-typeset {
background-image: url("assets/images/draft.svg");
background-size: 100%;
} There is a chance that some elements may have a background that covers the image, though. Seems to be the case with admonitions. I am sure it is also possible to cook up some CSS that just places the draft message over everything. That would take a bit of research or deeper CSS skills than I have a the moment. |
Beta Was this translation helpful? Give feedback.
-
Found a Codepen that does a similar things and modified the CSS a bit to get this: .md-content__inner.md-typeset:before {
content: "DRAFT";
-webkit-transform: rotate(331deg);
-moz-transform: rotate(331deg);
-o-transform: rotate(331deg);
transform: rotate(331deg);
font-size: 20em;
color: rgba(255, 5, 5, 0.17);
position: absolute;
} Hope this helps. Might need some refinement. |
Beta Was this translation helpful? Give feedback.
Found a Codepen that does a similar things and modified the CSS a bit to get this:
Hope this helps. Might need some refinement.