JSFiddle - React, Tailwind, and code Playground
HTML
<div id="cursor-block"></div>
<div class="container">
<a href="/">How can I act like this bar is not here and act on events (e.g. hover, click)?</a>
</div>
CSS
#cursor-block {
background: rgba(0, 0, 0, .075);
position: absolute;
top: 0;
bottom: 0;
width: 15px;
z-index: 2;
pointer-events: none;
}
.container {
background: #ddd;
border-bottom: 1px solid #aaa;
font-family: 'helvetica', 'arial', sans-serif;
height: 80px;
line-height: 80px;
text-align: center;
position: relative;
z-index: 1;
}
.container:hover {
background: #ccc;
}
.container a:hover {
color: black;
}
JavaScript
jQuery(function($) {
var cursorBlock = $('#cursor-block');
$(document).on('mousemove', function(e) {
cursorBlock.css({
left: e.pageX - 7
});
});
});