With HTML/CSS, how to create a non-rectangular red container like this:
which is basically a "rectangle avoiding a top right rectangle":
Is there another solution than having float: right;
for the top right blue container?
Reason: I'm looking for other methods than float: right
because of an Electron bug that prevent clicks to be caught correctly on the top right blue container, when the red container is a "draggable" title bar for an app window.
The following snippet works perfectly, but I'm looking for another solution without float: right
:
for (var i = 0; i < 50; i++)
document.getElementById("topleft").innerHTML += "<button>xyz" + i + "</button>";
* { margin: 0; }
#topright { float: right; width: 100px; background-color: blue; -webkit-app-region: no-drag; }
#topright:hover { background-color: black; }
#topleft { background-color: red; -webkit-app-region: drag; padding: 10px; }
<div id="topright" onclick="alert();">Click here!</div>
<div id="topleft"></div>