Position affecting height

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    #1

    Position affecting height

    Can anyone help me. I have a table inside a div. I've set the position of the table to realtive and now the header of the next div thinks it starts right where the table is. Is setting it the relative what's doing it?
    Code:
    .[I]my_div[/I] table{
    	position: relative;
    }
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    It would help to see some of the other code along with the browsers you're testing on.

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      I thouhgt you might say that. Sorry I was sreatched for time last night.

      Code:
      <div class="[I]my_div[/I]" id="[I]this_div[/I]">
        <h3>Heading</h3>
        <div> 
          <table width="100%" border="0" align="left" cellpadding="1" cellspacing="1">
            [I]table content[/I]
          </table> 
        </div>	
      </div>
      Code:
      .my_div table{
      	position: relative;
      }
      Is that enough code? I'm testing in Firefox but I seem to get the problem in most browsers (IE, Firefox, Google Chrome, Safari & Opera). I've been haing the problem for quite sometime but I'm at a loss of what's causing it.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I'm not seeing the overlap that you're seeing.

        Comment

        • KeredDrahcir
          Contributor
          • Nov 2009
          • 426

          #5
          Do you know what might cuase it? Anything thing that could cuase an overlap, or anything that could tell the container div how high to be since the table had different numbers of row depenging on how much data I need to present.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            It's hard to say, there could be margins, paddings, etc that can't be seen that may affect it.

            Can you attach a screenshot of the overlap?

            Comment

            • KeredDrahcir
              Contributor
              • Nov 2009
              • 426

              #7
              Adding in display: inline-block; seems to fix it. I've fixed one of the other elements that had a problem the same way and fixed the third adding that and removing a float.
              Is fixing it this way likely to cause any problems in the future that I need to be aware of?

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                Unfortunately I don't know CSS well enough to answer that question but perhaps one of the other experts will be able to.

                Comment

                • KeredDrahcir
                  Contributor
                  • Nov 2009
                  • 426

                  #9
                  Okay. Thanks for trying. At least it works now. If you're interested then I'll let you know of any issues to come up to help anyone else who had this problem.

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    Please do, if nothing else, it could help other people who look at this thread.

                    Comment

                    Working...