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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    z-index and image problem

    I am trying to get one layer with text to display over another which has an image. It works fine when the image is placed as a background using the class definition but not when it is placed via <img src=... I need to be able to control the image in the code rather than the stylesheet. Am I missing something basic? Here is a snip of the relevant code:

    #frame_title
    {
    height: 20px;
    display: block;
    z-index: 105;
    color: black;
    }

    #frame_content
    {
    height: 347px;
    display: block;
    margin-top: -20px;
    z-index: 101;
    }

    ...

    <div id=frame>
    ...

    <div id=frame_title>
    TEST TITLE
    </div>

    <div id=frame_content>
    <img src="clock_5.gif">
    </div>

    </div>

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    mile high city
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For the z-index to apply properly to a particular element you also need to set a value for the position attribute. Depending on the rest of your layout, you probably want to experiment with position:relative; or position:absolute;.

    Edit: This is a better link: http://brainjar.com/css/positioning/
    Last edited by mcdougals4all; 08-11-2005 at 10:25 PM.
    Computer, kill Flanders... Did I hear my name? My ears are burning...
    Good start. Now finish the job.

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    roger that, thanks, I'll give it a shot

  • #4
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that did it, thanks, I had a feeling it was something simple


  •  

    Posting Permissions

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