Html Canvas Overlay that allows content underneath to remain interactive

Trying to layer the canvas outlined in red over the div with a black border that is currently underneath. The canvas should match the size of the div, and I need to be able to interact with buttons and text beneath it. I've been at this for 48 hours and just can't seem to crack it...

https://i.sstatic.net/RAZKC.png

<canvas id="canvas">

</canvas>
<div class="jumbotron">
    <div class="container-fluid" id="canvas-container">
    </div>
</div>

Current CSS (I admit it's messy, but I've tried a lot of different things)

html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
  margin-top: 50px; /* Required margin for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 60px;
  background-color: #f5f5f5;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > .container {
  padding: 60px 15px 0;
}
.container .text-muted {
  margin: 20px 0;
}

.footer > .container {
  padding-right: 15px;
  padding-left: 15px;
}

code {
  font-size: 80%;
}

.jumbotron
{
  text-align: center;
}
#canvas-container
{
  padding: 0;
  //position: absolute;
  border: 1px solid black;
}
.jumbotron
{
    padding: 0;
    #position: absolute;
}

canvas {
  border: 1px solid red;
}

Answer №1

To resolve the issue, remember to:

canvas {
  pointer-events:none;
}

Feel free to experiment with clicking on the area beneath the red box in this js fiddle demonstration:

https://jsfiddle.net/1n1bp7m9/1/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

React Scheduler by Bryntum

After successfully discovering some functions related to various actions, I find myself still in need of additional functions: Currently, I am utilizing these functions by passing them directly as props to the Scheduler React Component: - onBeforeEventSa ...

HTML elements within the parent are seemingly enlarged compared to the parent element

I'm currently working on a project for an angular 2 recipe application, and I've encountered an issue with one of my HTML elements. The list items within the unordered list (which contain checkboxes) appear to be larger than the parent UL element ...

Multi-tier Dropdown with Dynamic Size Adjustment

I am attempting to adjust the size of a div container within a dropdown menu so that it properly accommodates the text inside. <div class='dropdown'> <button class ="dropbtn"><b>Hover!</b></button> <div c ...

ng-model based on various scenarios

I have two distinct arrays defined as : var oldarr = ['one','two','three']; var newarr = ['four','five','six']; var condi = 1 / 0; I am using the array values as ng-model options in a select d ...

Guide on inserting an array into Django HTML forms

I am a beginner in Django and I am looking to create a website that can modify tables in a database. The website should allow for changes, deletions, and additions of notes. The issue I'm facing is with one of the parameters, 'smj_prof', wh ...

Find strings that contain some text other than Angular expressions using Regex

I recently discovered a need to identify strings in our projects that are not AngularJS expressions due to expanding into multiple languages. This includes any string that is not completely enclosed in curly braces. My goal is to create a regex pattern th ...

The dimensions of the parent element do not match the width and height of the image

My friend requested that I look into an issue on his website. In the portfolio section, there is a border around the div and a rollover effect when hovering over the images. However, there is a strange problem where the box containing the image and data is ...

The properties of JavaFX in the CSS file are not recognized by Eclipse, showing an error message as "unknown property"

After installing Eclipse and downloading the OpenJFX SDK, I encountered an issue where Eclipse marked all -fx- properties in the .css file as warnings with the message "unknown property". Surprisingly, my JavaFX projects still compiled and ran smoothly, ...

Upon initiating a React Native project, five critical vulnerabilities become apparent

Upon starting my React Native project, I encountered 5 high severity vulnerabilities. Despite attempting to fix them with the command "npm audit fix --force", the issue persisted. I even went as far as reinstalling node.js and React Native, but the vulne ...

What is the best way to align several columns at the center in Bootstrap?

I'm struggling to center-align Card 1 so that it perfectly aligns in the middle of the page alongside the other cards (Card 2, Card 3, Card 4, Card 5). Despite numerous attempts, I can't seem to find a solution for this issue. Does anyone know ...

The combination of Vue.js and SVG modules resulting in misaligned nodes

Imagine having two vue components: parentComponent.vue <template> <svg> <child-component v-for="i in ['a', 'b']" :key="i"/> </svg> </template> ... childComponent.vue <template> <g> ...

Sorting the array in MongoDB before slicing it

Currently, I have a pipeline that aggregates Regions along with their respective countries and sales values. My goal is to obtain the top 5 countries by sales in each region using the $slice method. However, the issue I am facing is that it returns the fir ...

Unable to access the property 'function' of an undefined value

I've been attempting to call a function from another function within my React application. However, I am encountering an error that reads: Error in login TypeError: Cannot read property 'loadDashboard' of undefined. Despite researching simil ...

What is the correct method to include basic authentication headers in a post request for retrieving HTML content?

One of the projects I'm currently working on involves a POST endpoint that is protected by basic auth and returns an HTML form. This particular endpoint is hosted using an express server and secured with passport's basic auth. My goal is to creat ...

Executing JavaScript file using TypeScript code in Node.js

Is it possible to execute a JS file from TypeScript code in Node.js? One way to achieve this is by exposing the global scope and assigning values to it. For example: Global Scope (TypeScript): globalThis.names = ['Joe', 'Bob', 'J ...

ability to reach the sub-element dictionaries in typescript

class ProvinciaComponent extends CatalogoGenerico implements OnInit, AfterViewInit { page: Page = new Page({sort: {field: 'description', dir: 'asc'}}); dataSource: ProvinciaDataSource; columns = ['codprovi ...

end the node.js automated testing process

I'm currently using Jasmine and Zombie JS to create automated tests. I have integrated Drone.io for Continuous Integration, and the tests are executing successfully. However, there seems to be an issue where after passing the tests, the process does n ...

Assorted dimensions of square grid

Is it feasible to achieve the following using only HTML and CSS? The condition is that since the divs are automatically generated in a list, they should not be nested within another HTML element (such as adding a div for each line is restricted): Here is ...

Selecting items using raycasting

Currently attempting to select objects when clicked, using the common code found in various examples: function onMouseDown(evt) { evt.preventDefault(); canvasAbsoluteHeight = $('canvas').height(); canvasAbsoluteWidth = $('canv ...

Restricting the number of lines within a paragraph in Angular 2

Is there a method to limit the number of lines in a <p> tag and add an ellipsis (...) at the end? Using character count for truncation doesn't work well as the width of the element varies according to device screen size. ...