Results 1 to 8 of 8

Thread: firefox misplaces z-indexed div with image

  1. #1
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default firefox misplaces z-indexed div with image

    css:
    Code:
    #navimg{
    	display: inherit;
    	position:relative;
    	z-index:3;
    	width:271px;
    	height:264px;
    	margin-top: -40px;
    	
    }
    
    #nav{
    	width:285px;
    	float:right;
    	border-right:10px white solid;
    	border-top:10px white solid;
    	border-bottom:10px white solid;
    	border-left:none;
    	z-index:1;
    	background-color:#b3cdf2;
    }
    html:
    Code:
    <div>
    <div id="nav"><div id="logo">
    <img src="images/taflataf_logo.jpg" alt="logo" /></div>
    <hr />
    <ul><li>link1</li>
    <li>link2</li>
    <li>link3</li>
    </ul>
    </div>
    <div id="navimg"><img src="images/lego.gif" alt="" /></div>
    </div>
    <div class="clear"></div>
    
    </div>
    for some unknown reason ff 2.0.15 (the only Firefox i tested on)
    misplaces the div navimg.
    ie 6&7 placing everything as it should be.
    can someone help me please?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    You may wanna change:
    Code:
    #navimg{
    	display: inherit;
    	position:relative;
    	z-index:3;
    	width:271px;
    	height:264px;
    	margin-top: -40px;
    	
    }
    To:
    Code:
    #nav img{
    	display: inherit;
    	position:relative;
    	z-index:3;
    	width:271px;
    	height:264px;
    	margin-top: -40px;
    	
    }
    See if that helps. If that doesn't work, make it a class.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    genia (04-25-2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    thanks for the quick replay.
    i cant make it #nav img since it has more than one image.
    tried making it class and still the same thing-it place it at the top left corner.

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    From my knowledge saying:
    Code:
    #navimg
    Is a div with the id navimg. Try my solution with more then one image. I think that it will work.
    Jeremy | jfein.net

  6. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Nile View Post
    From my knowledge saying:
    Code:
    #navimg
    Is a div with the id navimg. Try my solution with more then one image. I think that it will work.
    you could also do

    Code:
    #navimg img {yada}
    since there is an image tag within that div

  7. #6
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    i tried to change it to .navimg and the atrrib to class="navimg"
    and still it doesnt work.
    #navimg or #nav img wont change the fact that it still misplaces it.

    uploaded it:
    http://shenkar.co.il/Genia/taf/

    and thank you all again for the replayes

  8. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Since your positioningi it relatively to the container that holds your div...then floating your element to the right will aide

    Add the highlighted:
    Code:
    #navimg{
    	display: inherit;
    	position:relative;
    	float:right;
    	z-index:3;
    	width:271px;
    	height:264px;
    	margin-top: -40px;
    }
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  9. The Following User Says Thank You to rangana For This Useful Post:

    genia (04-26-2008)

  10. #8
    Join Date
    Jan 2008
    Posts
    73
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    rangana,you rock!! it works,thanks for the explanation
    finally my first cross browser(i hope) css.

    thanks you all again.

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
  •