Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts

    code to send image up front

    hi i have background and i want a image to go in front of the abckground but its always in back so you cant see it...is there a code to make the image go up front of the background and not in back?

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    set background image as this

    Code:
    .backgroundImg {
    position:absolute;
    top:0px;
    left:0px;
    width:/*whatever*/;
    height:/*whatever*/;
    z-index:1;
    }
    
    .frontImg {
    position:absolute;
    top:100px;
    left:100px;
    width:/*whatever*/;
    height:/*whatever*/;
    z-index:10;
    }
    That should work.

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    even this part of the code?

    Code:
    .frontImg {
    position:absolute;
    top:100px;
    left:100px;
    width:/*whatever*/;
    height:/*whatever*/;
    z-index:10;
    }

  • #4
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    not sure what you mean by that sorry. You need to apply the class "frontImg" to your top image and apply the class "backgroundImg" to your background that way it will work

    HTML
    Code:
    <img src="back.gif" class="backgroundImg" />
    <img src="front.gif" class="frontImg" />

  • Users who have thanked jcdevelopment for this post:

    tylerbe992 (07-10-2008)

  • #5
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    it worked! thxs! now how do i make this image repeat?

    Code:
    <img style="Z-INDEX: 100; POSITION: absolute" height="9" alt="" src="top.gif" width="32" border="0">&#160;

  • #6
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    add this to your style

    background-repeat:repeat;

    you have to set a width and height i believe!

  • #7
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    whats my style?

  • #8
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Code:
    <img style="Z-INDEX: 100; POSITION: absolute" height="9" alt="" src="top.gif" width="32" border="0">

  • #9
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    can u add it in for me and then send it to me plz

    because im such a newbie

  • #10
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    Code:
    <img style="z-index: 100; position: absolute; height:9px; width:32px; background-repeat:repeat;" alt="" src="top.gif" border="0">
    That should do it, let me know!

  • #11
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    no didnt work but its ok...im donig this...
    Code:
    <img style="Z-INDEX:  100; LEFT:   0px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT:  30px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT:  60px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT:  90px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 120px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 150px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 180px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 210px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 240px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 270px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 300px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 330px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 360px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 390px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">
    <img style="Z-INDEX:  100; LEFT: 420px; POSITION: absolute; TOP: 18px" height="9" alt="" src="top.gif" width="30" border="0">




    lol

  • #12
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    try this instead

    <body style="background-image:url(top.gif);">

  • #13
    New Coder
    Join Date
    May 2008
    Posts
    58
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thxs for the help man but i'll just do the copy and paste instead

    thxs for your help alot though!


  • #14
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    no problem, good luck!


  •  

    Posting Permissions

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