Results 1 to 2 of 2

Thread: How to got two images in the same place

  1. #1
    Join Date
    Sep 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to got two images in the same place

    Hi guys, how can I get two images in the same place on different z-index. Only one of image can be visible becouse second image is under this first. I want to work on two images, and when user clicked button "up" z-index of first image will change value to go on front and when user unclicked this button image from front will go under this second image. But first of all I must to got images of the same size in one place. Problem for me is that one image is <canvas> and second is <svg>. So when button clicked i see only canvas
    Code:
    <canvas><svg></svg></canvas>
    , when button unclicked I see only svg
    Code:
    <svg><canvas></canvas></svg>
    Which css property should i used ?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not certain this can be done with svg and canvas. But it shouldn't be either of the two things you have. It should be:

    Code:
    <svg></svg><canvas></canvas>
    or:

    Code:
    <canvas></canvas><svg></svg>
    Because anything non-svg contained in svg ends svg and visa versa with the canvas tag.

    Then you can stack them by using each of their own methods for positioning. Using z-index for canvas may work. The svg may actually have to be rendered invisible in some manner to get it to appear to fall behind the canvas element. Are these the same size? That is, if one is on top of the other would it cover the other completely?

    If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Script to place customisable text on images
    By TR123 in forum Looking for such a script or service
    Replies: 0
    Last Post: 08-02-2012, 11:51 AM
  2. Resolved show images in grid and place title underneath
    By ggalan in forum CSS
    Replies: 0
    Last Post: 09-24-2010, 08:49 PM
  3. Replies: 1
    Last Post: 05-09-2010, 10:17 AM
  4. Images out of place
    By danielmeade in forum PHP
    Replies: 2
    Last Post: 02-19-2010, 04:55 AM
  5. Replies: 5
    Last Post: 06-22-2008, 02:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •