targeted anchor not shown in ff

Discussion in 'CSS' started by bosstjan, Apr 23, 2007.

  1. #1
    Hi,

    I encountered strange problem - maybe someone already solved it (well, actually I did, but it's still strange to me, why this happened)...

    I have a page which uses anchors. Just short example:
    <ol>
    	<li><a href="#faq_1" title="faq1">FAQ 1</a></li>
    	<li><a href="#faq_2" title="faq2">FAQ 2</a></li>
    	<li><a href="#faq_3" title="faq3">FAQ 3</a></li>
    </ol>
    <br />
    <br />
    <br />
    
    <a id="faq_1" name="faq_1"></a><b>1. FAQ 1</b><br />
    FAQ 1 TEXT
    <a href="#top" class="bold">to top...</a><br />
    <br />
    <br />
    <a id="faq_2" name="faq_2"></a><b>2. FAQ 2</b><br />
    FAQ 1 TEXT
    <a href="#top" class="bold">to top...</a><br />
    <br />
    <br />
    <a id="faq_3" name="faq_3"></a><b>3. FAQ 3</b><br />
    FAQ 1 TEXT
    <a href="#top" class="bold">to top...</a><br />
    <br />
    <br />
    
    Code (markup):
    This code is inside a div, which is determined in css file. part of CSS:
    #mainLeftCol {
    	display: inline;
    	float: left;
    	width: 704px;
    	padding: 20px 38px 40px 8px;
    }
    
    Code (markup):
    The problem is as follows:
    When I click on link in FF, display jumps to about half or 3/4 of line below targeted anchor - so I see just very small part of line (just a little of bottom pixels). It works fine in IE - it jumps to correct location and displays the whole line.

    If I remove line "float: left;" out of css div class, it also works fine in FF. But in that case, I don't like my new layout :rolleyes:. It works also, if I put all my upper code in new <div></div> and put all that into div with id #mainLeftCol

    Does anybody has a clue, why is that so?

    I'll be thankful for every opinion.
    Bostjan
     
    bosstjan, Apr 23, 2007 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Are you using a doctype at the top of your HTML file? Be easier if you linked to the site itself.
     
    AdamSee, Apr 23, 2007 IP
  3. bosstjan

    bosstjan Peon

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, I'm using XHTML Transitional. Is that the case?
     
    bosstjan, Apr 24, 2007 IP
  4. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Doubtful. If you don't link the whole site it's going to be hard to find out what's wrong. Can't see anything particularly strange there.
     
    AdamSee, Apr 25, 2007 IP