Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8997531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:54:07+00:00 2026-06-15T23:54:07+00:00

Here is my problem for today, I try to draw something on an <

  • 0

Here is my problem for today, I try to draw something on an <img> this is a structure

<div id='...' style='position:relative;'>
  <img id='...' style='posistion:absolute;' />
  <canvas id ='...' style='position:absolute;' />
</div>

img in css has already

-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
user-select: none;

How can i draw a canvas ON the image? For now it go behind. I can’t use z-index on canvas. I tried making other divs. It has to be an img. Should i use something else instead of canvas? I could use other div but the paths i want to draw are not really simple and has to be resizable when image is bigger/smaller and still look fine.
Thanks in advice, hope everyone understood my english.

to make it more clear what i want here is a code when canvas is behind. When I prepend not append canvas an image is gone. I want to put a path to show user that this is already deleted but there are sometimes on this screen many other divs so i want to put canvas on a IMG or a DIV the img is in. It has to be in front of because when img is large we will not see path under. Here is a link
https://dl.dropbox.com/u/6421191/canvasbehind.jpg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:54:08+00:00Added an answer on June 15, 2026 at 11:54 pm

    HTML

    <div id='mydiv' >
      <img id='myimage' src="http://placekitten.com/200/385" />
      <canvas id ='mycanvas'  width="200" height="100" />
    </div>
    

    CSS

    div#mydiv{
        position: relative;
    }
    #myimage{
         position: relative;
    }
    #mycanvas{
        position: absolute;
        top: 0;
        left: 0;
        background-color: #333;
    }
    

    I think this is what you are trying do.

    Have one image on the background and display the canvas area on top of the image?

    I hope my little sample code helps you out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I spent a bit of time today tackling the equilibrium index problem (described here
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
Sorry for this guys, but I really am unlucky today. Please help, my problem
I decided to try project euler problem 17 today, and I quickly wrote a
Hey all of you at Stackoverflow. I got this incredibly annoying problem. I try
The problem here is how to add an NSPopUpButton in Xcode 4's Interface Builder
date here my problem: String datetime = 2012-03-24 23:20:51; I know that that string
Super weird problem here. I'm having trouble getting jQuery to bind any selectors except
I have a problem here im trying to upload a file first time it
Im having a problem here. i downloaded jake wharton. He gave an example of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.