SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML 5 Canvas Vs Z-Index

    Hi forum experts,

    I remember playing with Z-Index in terms of placing my image at the location desired in my web-site.

    Now, with HTML 5 Canvas, I wonder if Z-Index is no longer valid?

    Hope to hear from you soon.

    Thanks!

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    In Canvas you basically print pixels on top of the existing painting like paint on a... canvas

    Animation is mostly frame by frame where you paint, clear, paint, clear etc..

    So, z-index doesn't make sense because there's no such thing as layers - there's only ever 1 layer.

    Hope it helps

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,599
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Yes, z-index still very much has its place in CSS, and will continue to do so.

  4. #4
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    In Canvas you basically print pixels on top of the existing painting like paint on a... canvas

    Animation is mostly frame by frame where you paint, clear, paint, clear etc..

    So, z-index doesn't make sense because there's no such thing as layers - there's only ever 1 layer.

    Hope it helps

    Erm...do you have an example to show you meant ? Can't really understand putting a layer on top of another. Isn't Z Index work the same. We put in a background colour and then we use the Z-Index to put another image on top ?

  5. #5
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I read more into your question than I should have, see Ralph's answer above.
    The majority of websites don't need canvas at all, it has a very small use-case.

    If you do need canvas for something in the future you'll learn that it's just an element that you can paint pixels onto.
    you can't have multiple elements in a canvas at different z-index. There's only ever one element the <canvas>


Tags for this Thread

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
  •