Long time ago, with outdated browsers (chrome38) people could make boxes...
It was possible to use outline-color: invert
to choose a color who was the exact opposite of the background.
Today, such a great feature does not exist anymore :( Do yo have an idea for me who just want to display boxes with borders of the opposite color of the background ?
(today chrome (39) compute outline-color: invert
to outline-color:transparent
.
before that outline-color: invert
rendered to outline-color: rgb(255,255,255)
on a black brackground.)
Thanks for your ideas.
Perhaps this does the trick for you?
.background {
display: inline-block;
margin: 10px;
padding: 20px;
}
.box {
border: 3px solid white;
height: 100px;
width: 160px;
}
.invert {
mix-blend-mode: difference;
}
<div class="background" style="background: #ff0000">
<div class="box invert"></div>
</div>
<div class="background" style="background: #000000">
<div class="box invert"></div>
</div>
<div class="background" style="background: #ffffff">
<div class="box invert"></div>
</div>
http://codepen.io/Frikki/pen/BNpKYb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With