I'd like to make it clear from the get-go that I know how to link text and images through wikitext. I know that both of these examples work, and I know how they work.
[[Home]]
[[File:Knit Hat.png|link=Home|100px]]
What I'm looking for is distinctly different. I'm looking for a linked <div> element, or something similar to it.
I'm not interested in linking the content within the <div>, as then only the parts of the div with text on it would be linked. In this example, I would want the bottom/bottom-right of the div to also be a link.
<div style="background: lime; width: 100px; height: 100px;">
div element with content in it
</div>
<div style="background: lime; width: 100px; height: 100px;">
[[Home|I don't want this]]
</div>
I have found a hacky thing that is sort of able to recreate what I want, being a <span> tag with a bunch of styling within the link's text to display, but it has a major issue in the fact it breaks if images are in the element, which I need from it.
[[Home|<span style="background: hsl(170 50% 50%); width: 100px; height: 100px; display: block;">linked span element with content in it</span>]]
[[Home|<span style="background: hsl(190 50% 50%); width: 200px; height: 200px; display: block;">but it falls apart if there's an image [[File:Knit Hat.png|50px]]</span>]]
This would be used in a template that asks for images from the editor, so I can't use CSS to try and hard-code a background (and in turn, an image) to the linked element.
Basically, think of YouTube's website. You don't necessarily have to click on the video's thumbnail or title to open it; you can click the empty bottom right, which has no content but is still within the video's block element, and still open the video. That's what I want from my template.
If you're wondering, I can't use the "a" tag itself because it is not a part of MediaWiki's list of allowed HTML tags.
If you want to see a live version of the examples I used in this post, see here.
Anyways, what are some solutions?