I've got a div( well it's actually a <th> but I don't think that's relevant) with some dynamically-sized content in it.
I'd like to put a border triangle in the parent div, that fills it (base same width as div, height same height as div).
With a fixed parent div size I can do it as below. Is it possible to do this without a fixed parent div size? I'm using VueJs if that's any use
.crossedleft {
background:
linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.8px),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.8px),
rgba(0,0,0,0) 100%)
}
.crossedright {
background:
linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.8px),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.8px),
rgba(0,0,0,0) 100%)
}
<div style="height:50px;width:100px">
<div class="crossedleft" style="position:absolute; height:50px;width:50px">
<div class="crossedright" style="position:absolute; height:50px;width:50px;left:50px">
</div>
<pre>
content
</pre>
</div>